815 views
in System Integration by
Hi

I'm using the Raspberry Pi 3 to run example " DeviceIntegration", but  the external elements(LED and button) don't respond, only the button to send the string work

1 Answer

+1 vote
by
 
Best answer

Hi,

have you installed the WiringPi library? Have you connected your LED and button correctly? Does your LED work with a simple WiringPi test?

Best regards,

Manfred.

by
Hello,

o.k. the origin question was "Raspberry Pi Example DeviceIntegration doesn't work..." - now, we know that you have modified the main.c file.

Please note, that the main.c that you found in some other answer was uploaded in 2017 for some older version. Meanwhile the entire structure of our Build Environment has changed and enhanced - e.g. to simplify the integration of devices...

Please take the original Build Environment for Raspberry Pi and then you will see that the Device Integration example works fine. If you need some adaptations because of your display or touch, please make these changes within the corresponding module (/TargetSpecific/ew_bsp_display.c or ew_bsp_touch.c).

Best regards,

Manfred.
by
Hello

Thanks for your comment Manfred.

Ok, checked the file w_bsp_touch.c and print the coordinates, it only recognizes the touch of the upper left corner.

---------------------------------------------
Touch event for finger 0 with state 1 (  233,  475 )
Touch event for finger 0 with state 2 (  235,  473 )
Touch event for finger 0 with state 2 (  236,  480 )
Touch event for finger 0 with state 3 (  236,  480 )
Touch event for finger 0 with state 1 (  227,  480 )
Touch event for finger 0 with state 2 (  236,  473 )
Touch event for finger 0 with state 2 (  225,  480 )
Touch event for finger 0 with state 2 (  223,  474 )
Touch event for finger 0 with state 2 (  234,  469 )
Touch event for finger 0 with state 2 (  227,  469 )
Touch event for finger 0 with state 2 (  228,  476 )
Touch event for finger 0 with state 2 (  236,  473 )
Touch event for finger 0 with state 3 (  236,  473 )
Touch event for finger 0 with state 1 (  442,  471 )
Touch event for finger 0 with state 2 (  443,  480 )
Touch event for finger 0 with state 2 (  442,  480 )
Touch event for finger 0 with state 2 (  448,  478 )
Touch event for finger 0 with state 3 (  448,  478 )
Touch event for finger 0 with state 1 (  446,  476 )
Touch event for finger 0 with state 3 (  446,  476 )
Touch event for finger 0 with state 1 (  435,  480 )
Touch event for finger 0 with state 3 (  435,  480 )
Touch event for finger 0 with state 1 (  356,  475 )
Touch event for finger 0 with state 2 (  356,  470 )
Touch event for finger 0 with state 2 (  348,  475 )
Touch event for finger 0 with state 2 (  351,  476 )
Touch event for finger 0 with state 2 (  355,  471 )
Touch event for finger 0 with state 2 (  356,  465 )
Touch event for finger 0 with state 2 (  348,  474 )
Touch event for finger 0 with state 2 (  353,  473 )
Touch event for finger 0 with state 2 (  347,  480 )
Touch event for finger 0 with state 2 (  349,  480 )
Touch event for finger 0 with state 2 (  358,  467 )
Touch event for finger 0 with state 3 (  358,  467 )
Touch event for finger 0 with state 1 (  289,  479 )
Touch event for finger 0 with state 3 (  289,  479 )
Touch event for finger 0 with state 1 (  285,  479 )
Touch event for finger 0 with state 3 (  285,  479 )
 

I use a 5-inch display with 800x480 resolution

How can I solve that?
by

Maybe it is the easiest, when you compare the touch detection from your working main.c file with the touch detection of the current ew_bsp_touch.c implemenation. It assume that your touch driver provides the values with some offset and scaling.

The current touch coordinates are used as they are:

        if ( code == ABS_MT_POSITION_X )
          touchX = value;
        else if ( code == ABS_MT_POSITION_Y )
          touchY = value;

 

Now you can add your offset/scaling:

        if ( code == ABS_MT_POSITION_X )
          touchX = ( TouchAreaWidth * ( 
value - X_MIN )) / ( X_MAX - X_MIN );
        else if ( code == ABS_MT_POSITION_Y )
          touchY = ( TouchAreaHeight * ( value - Y_MIN )) / ( Y_MAX - Y_MIN );

(Remark: This code is not tested - it is based on the main.c that you have referred....)

Best regards,

Manfred.

 

by
Thank you very much for all your help Manfred.

It works correctly.
by
Great! Thank you!

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...