Announcement

Collapse
No announcement yet.

can't get touch coordinates NO TOUCH ACTIVITY to work pls help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • can't get touch coordinates NO TOUCH ACTIVITY to work pls help

    Hi,
    I'm trying to get touch coordinates to work but no success...
    This works fine :

    putc(0x6F); //cmd
    putc(0x01);*/ //wait until touch press

    ... but I want to do function show_freq_level(); in loop for many many times while waiting for touch press:

    do{
    //do{
    show_freq_level(); //WANT TO GO TO THIS FUNCTION
    //FUNCTION LAST ABOUT 2 SECONDS

    //THEN ASK IF THRERE'S ANY TOUCH ACTIVITY
    putc(0x6F); //cmd
    putc(0x04); //get touch status

    //DO I HAVE TO WAIT ACK IB N THIS SITUATION??
    com_ok(); //THIS WAITS FOR ACK (0X06)... IT WORKS FINE ELSEWHERE IN MY CODE

    while(!kbhit(LCD));

    delay_us(1);
    touch_status_MSB = getc(LCD);//read character from UART
    touch_status_LSB = getc(LCD);
    //IF THERE IS'NT ANY TOUCH ACTIVITY RETURN TO FUNCTION show_freq_level(); }while(touch_status_LSB == 0);

    but now my program don't react touching at all...
    (show_freq_level() works ok)

    So I like to know how and where and when (and how to use it) 0x6F 0x04 returns it's status value?
    (If status is 0: no touch activity)

    Is it one byte or two byte value ?

    //these lines work fine to get touch goordinates
    touch_status_MSB = getc(LCD);//read character from UART
    touch_status_LSB = getc(LCD);



    best regards

    -arto-

  • #2


    All touch commands always return 4 bytes, as per the manual.
    Mark

    Comment


    • #3


      ESPsupport wrote: All touch commands always return 4 bytes, as per the manual.
      Don't forget to look for the status reply in the second byte of the 4 byte response.


      BTW:
      The manual I have, "PICASO-SGC_COMMANDS-SIS-rev9.pdf", is currently a little vague on that point.
      The example given for touch status almost implies 2 bytes:

      Serial ExampleCommand Data:6Fhex, 04hexPICASO-SGC Response:02hexGet Touch Status, Touch release reported.

      Comment


      • #4


        Yeah, people who 'skim' might miss the earlier line that says

        Response x_coord(msb:lsb), y_coord(msb:lsb)

        We'll see what can be done
        Mark

        Comment


        • #5


          I think that part was fine. A little blurb about the layout of the message returned by the statuscommand is all you need there, since that's the only oddball.

          Comment

          Working...
          X