Announcement

Collapse
No announcement yet.

Touch Events (ts.x();ts.y())

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

  • Touch Events (ts.x();ts.y())

    Hi Everyone

    I realize this is probably the wrong place to post this question but I wasn't sure under which category it falls under.

    I was wondering if there is a simpler way then creating vector to check previous to reset ts.x and ts.y to "0" on release

    i.e.
    Code:
    sprintf(str, "%d %d %d*", thisArduino, ts.x(), ts.y());
    As of now, ts.x(), ts.y () will always maintain the value of the last touch but I want them to have a value 0 upon release.

    Any thoughts on whether there's a simpler way to do this?

    Thanks in advance
    Antonio
    Last edited by antpgomes; 25th July 2014, 10:04 AM.

  • #2
    Hello

    Sorry I have no idea what product you are even trying to use.
    Please provide more information and the topic can be moved to the right place.
    Is this for the PICadillo-35T ?

    Regards
    James

    Comment


    • antpgomes
      antpgomes commented
      Editing a comment
      Hi James,

      Correct, PICadillo-35T although I assume that would work for other products. I know it does for Diablo16.

      I am however, using VS to process touch events and if I assign a touchstate to the x,y coordinates on the uecide side It works perfectly.

      I was just curious to know what was the choice to have your products maintain the last touch coordinates as this is not the standard behavior for resistive touchscreen, where coordinates will default to "0" upon release

      Best
      Antonio

  • #3
    Moved the topic to the PICadillo-35T area.
    James

    Comment


    • #4
      Hmm, Well 4DGL maintains the last X/Y coordinate as it is only 'updated' on a get of the touch status (specifically so it corresponds to the position as at the touch status call).

      I have no idea what PICadillo does, hopefully someone familiar with it will answer.

      As for resetting to 0 on release, surely that can't be right, after all 0,0 is a valid place to touch.

      Also, it must depend a lot on whether what you are looking at is a 'static' value, or the 'dynamic' 'as of this instant' value.
      Mark

      Comment


      • #5
        The x/y is the last value gleaned from the touch screen the last time it was sampled. This may, or may not, be a valid value. You should check the return value of isPressed() to know if the values given by x() and y() are valid.

        It is your responsibility to record those values for your own use should you wish to.

        Comment


        • #6
          Understood sirs. Thanks for the prompt reply.

          I have very little experience with resistive touchscreens and having been recently tinkering around with 4wire and 328p's where I do get a static value on release I was wondering if I was doing something "wrong" with the picadillo but I am guessing this is due to the way in which I handle a touchsensor with the arduino.

          Anyway, I understand how to handle it in code and I very much appreciate your input

          Comment


          • #7
            I am however, using VS to process touch events and if I assign a touchstate to the x,y coordinates on the uecide side It works perfectly. I was just curious to know what was the choice to have your products maintain the last touch coordinates as this is not the standard behavior for resistive touchscreen, where coordinates will default to "0" upon release????

            Comment

            Working...
            X