TouchscreenUSB.release(finger), Touch freezes, bug with Linux??

10 simultaneous touch drawing confirmed, on Linux.

View attachment 12750

Code:
#include <Bounce.h>

Bounce mybutton = Bounce(14, 10);
int yoffset = 6000;

void setup() {
  pinMode(14, INPUT_PULLUP);
  digitalWrite(13, LOW);
  TouchscreenUSB.begin();
}

void drawcircle(int x, int y) {
  float arc = 2.0 * PI / 10.0;
  float r = 3000.0;
  for (float angle=0; angle < arc; angle += 0.01) {
    for (int i=0; i < 10; i++) {
      float ph = arc * (float)i;
      TouchscreenUSB.press(i, r * cosf(angle+ph) + x, r * sinf(angle+ph) + y);
    }
    delay(10);
  }
  for (int i=0; i < 10; i++) {
    TouchscreenUSB.release(i);
  }
}

void loop() {
  mybutton.update();
  if (mybutton.fallingEdge()) {
    Serial.println("press");
    drawcircle(16000, yoffset);
    yoffset += 4200;
    if (yoffset > 24000) yoffset = 4000;
  }
}

woooow, that looks great :-D !!! I will test that ASAP, I think today evening.
 
soo I really don't know how to be thankfull for your works - it's really amazing it works like a charm!!! :-D :-D
I made first picture, I have also other display with goodix, cypress and now I can simply implement it with raspberry without need of search/make complicated driver build kernel on linux.
That's very very great, awesome! :-D :-D
 

Attachments

  • 20180127_235322-02.jpg
    20180127_235322-02.jpg
    81.4 KB · Views: 134
  • 20180127_235028-01.jpg
    20180127_235028-01.jpg
    100.1 KB · Views: 136
Hello Paul

> I am indeed testing with Linux. Maybe you're assuming I don't test Linux because I read the only available documentation?

No.
I deduced that because it is strange that there is such a severe bug as reported by epikao (Linux freezing) and you did not find this in your tests.


> Please point me to any solid documentation for Linux or Mac and I will use it.

I did not find anything.
The MSDN seems to be the only place with offical examples. But I have seen many wrong example code in the MSDN in many places.
So the only way is testing your descriptors on as many operating systems as possible.


> That site is responding *very* slowly, and when it finally does anything, I get "You must logon to download zip files."

Codeproject is as fast as any other page. For me at least.
Codeproject requires you to log on to download sourcecode. You can create an account for free in less than a minute.
This is not strange. Your forum here also requires me to log on.


> I currently don't have time to test this.
> This is not the sort of feedback I'm interested to hear.

I imagine.
When I have time again I will test your modified code on all operating systems that I have available.
 
This is not strange. Your forum here also requires me to log on.

Are you sure about that?

I logged out just now, then went to message #20 in this thread. I was able to download the files without being logged in.

Of course you do need to be logged in to post messages. The registration process is the main way we keep the spam problem under control.
 
Hello again. I will post asap more about your great touchscreen function :-D:D

but I have still another issue; I don't know If you know KODI?
However, KODI respectively OSMC don't use the X11, they use GLESv2. So because of that or according people on the forum some USB-Touchscreen (and your touchscreen function) are not working (KODI with ARM-Processor).
Unfortunately they say that is a driver Issue, so the Manufacturer of the Touchscreen must improve that.
My USB Touchscreen with Atmel Controller is working with KODI and ARM-Processor respectively with Raspberry Pi.

So I don't want disturb you more, but just wanted know If you know KODI, and if you would have any first idea what the problem could be?

Please note: I think your touchscreen function will work with KODI on a X86 machine, but not on a ARM machine...
 

thanks for the reply.
I download the latest code from jz11... so if I see and understand that correct, your new updated USB Functions already works with Android? (without modify of your descriptor or something else...)
As Android is based on ARM processor I maybe must find out the used driver in Android and port to the KODI systems.... but I think that will be difficult.

Maybe I should send you my USB-Touchscreen with that Atmel Controller. Until know I didn't find a system which that Touchscreen is not working....
 
yes OSMC is a lightweight OS that i used to use on a raspberri too, its dedication was for KODI, which was formerly known as XBMC. this lightweight ‘OS’ has limited driverset, ive had one usb keyboard not work with it, even a usb wireless mouse, but others worked. you may think of it an nLite version of XP. Also, some ‘android’ based remotes just dont work properly if at all unless they are on the “supported” remote list in the GUI config
 
I suppose the Dell P2314T ,which this Touchscreen Function are based, is not really a new Touchscreen? My USB Touchscreen with the Atmel Controller I think is a much newer Generation.
So maybe that would be the root cause why the touch-function are not working on KODI with Raspberry.

Maybe if it's helpfull I could read my Atmel USB Touchscreen with USBlyzer? Maybe somebody could give me advise what I should do with that Programm, respectively which data would be usefull.

Maybe there is only a simple obvious difference to the Dell Touchscreen - so that it would be easy to adapt?
Or another option it would be that I send my Touchscreen to Paul or Elmue? for analyze....
 
Here's a text version, extracted from that PDF:

Code:
 Interface 0 HID Report Descriptor Touch Screen
Item Tag (Value)                                      Raw Data
Usage Page (Digitizer)                                05 0D
Usage (Touch Screen)                                  09 04
Collection (Application)                              A1 01
   Report ID (1)                                      85 01
   Usage (Finger)                                     09 22
   Collection (Logical)                               A1 02
     Usage (Tip Switch)                               09 42
     Logical Minimum (0)                              15 00
     Logical Maximum (1)                              25 01
     Report Size (1)                                  75 01
     Report Count (1)                                 95 01
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Logical Maximum (31)                             25 1F
     Report Size (5)                                  75 05
     Usage (Contact Identifier)                       09 51
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage Page (Generic Desktop)                     05 01
     Unit Exponent (-2)                               55 0E
     Unit (SI Lin: Length (cm))                       65 11
     Physical Minimum (0)                             35 00
     Report Size (16)                                 75 10
     Report Count (1)                                 95 01
     Physical Maximum (2180)                          46 84 08
     Logical Maximum (1023)                           26 FF 03
     Usage (X)                                        09 30
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Physical Maximum (1370)                          46 5A 05
     Logical Maximum (1023)                           26 FF 03
     Usage (Y)                                        09 31
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage Page (Digitizer)                           05 0D
     Report Count (1)                                 95 01
     Report Size (8)                                  75 08
     Logical Minimum (0)                              15 00
     Logical Maximum (255)                            26 FF 00
     Physical Maximum (255)                           46 FF 00
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
   End Collection                                     C0
   Usage (Finger)                                     09 22
   Collection (Logical)                               A1 02
     Usage (Tip Switch)                               09 42
     Logical Minimum (0)                              15 00
     Logical Maximum (1)                              25 01
     Report Size (1)                                  75 01
     Report Count (1)                                 95 01
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Logical Maximum (31)                             25 1F
     Report Size (5)                                  75 05
     Usage (Contact Identifier)                       09 51
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage Page (Generic Desktop)                     05 01
     Unit Exponent (-2)                               55 0E
     Unit (SI Lin: Length (cm))                       65 11
     Physical Minimum (0)                             35 00
     Report Size (16)                                 75 10
     Report Count (1)                                 95 01
     Physical Maximum (2180)                          46 84 08
     Logical Maximum (1023)                           26 FF 03
     Usage (X)                                        09 30
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Physical Maximum (1370)                          46 5A 05
     Logical Maximum (1023)                           26 FF 03
     Usage (Y)                                        09 31
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage Page (Digitizer)                           05 0D
     Report Count (1)                                 95 01
     Report Size (8)                                  75 08
     Logical Minimum (0)                              15 00
     Logical Maximum (255)                            26 FF 00
     Physical Maximum (255)                           46 FF 00
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
   End Collection                                     C0
   Usage (Finger)                                     09 22
   Collection (Logical)                               A1 02
     Usage (Tip Switch)                               09 42
     Logical Minimum (0)                              15 00
     Logical Maximum (1)                              25 01
     Report Size (1)                                  75 01
     Report Count (1)                                 95 01
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Logical Maximum (31)                             25 1F
     Report Size (5)                                  75 05
     Usage (Contact Identifier)                       09 51
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage Page (Generic Desktop)                     05 01
     Unit Exponent (-2)                               55 0E
     Unit (SI Lin: Length (cm))                       65 11
     Physical Minimum (0)                             35 00
     Report Size (16)                                 75 10
     Report Count (1)                                 95 01
     Physical Maximum (2180)                          46 84 08
     Logical Maximum (1023)                           26 FF 03
     Usage (X)                                        09 30
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Physical Maximum (1370)                          46 5A 05
     Logical Maximum (1023)                           26 FF 03
     Usage (Y)                                        09 31
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage Page (Digitizer)                           05 0D
     Report Count (1)                                 95 01
     Report Size (8)                                  75 08
     Logical Minimum (0)                              15 00
     Logical Maximum (255)                            26 FF 00
     Physical Maximum (255)                           46 FF 00
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
   End Collection                                     C0
   Usage (Finger)                                     09 22
   Collection (Logical)                               A1 02
     Usage (Tip Switch)                               09 42
     Logical Minimum (0)                              15 00
     Logical Maximum (1)                              25 01
     Report Size (1)                                  75 01
     Report Count (1)                                 95 01
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Logical Maximum (31)                             25 1F
     Report Size (5)                                  75 05
     Usage (Contact Identifier)                       09 51
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage Page (Generic Desktop)                     05 01
     Unit Exponent (-2)                               55 0E
     Unit (SI Lin: Length (cm))                       65 11
     Physical Minimum (0)                             35 00
     Report Size (16)                                 75 10
     Report Count (1)                                 95 01
     Physical Maximum (2180)                          46 84 08
     Logical Maximum (1023)                           26 FF 03
     Usage (X)                                        09 30
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Physical Maximum (1370)                          46 5A 05
     Logical Maximum (1023)                           26 FF 03
     Usage (Y)                                        09 31
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage Page (Digitizer)                           05 0D
     Report Count (1)                                 95 01
     Report Size (8)                                  75 08
     Logical Minimum (0)                              15 00
     Logical Maximum (255)                            26 FF 00
     Physical Maximum (255)                           46 FF 00
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
   End Collection                                     C0
   Usage (Finger)                                     09 22
   Collection (Logical)                               A1 02
     Usage (Tip Switch)                               09 42
     Logical Minimum (0)                              15 00
     Logical Maximum (1)                              25 01
     Report Size (1)                                  75 01
     Report Count (1)                                 95 01
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Report Count (1)                                 95 01
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Logical Maximum (31)                             25 1F
     Report Size (5)                                  75 05
     Usage (Contact Identifier)                       09 51
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage Page (Generic Desktop)                     05 01
     Unit Exponent (-2)                               55 0E
     Unit (SI Lin: Length (cm))                       65 11
     Physical Minimum (0)                             35 00
     Report Size (16)                                 75 10
     Report Count (1)                                 95 01
     Physical Maximum (2180)                          46 84 08
     Logical Maximum (1023)                           26 FF 03
     Usage (X)                                        09 30
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Physical Maximum (1370)                          46 5A 05
     Logical Maximum (1023)                           26 FF 03
     Usage (Y)                                        09 31
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage Page (Digitizer)                           05 0D
     Report Count (1)                                 95 01
     Report Size (8)                                  75 08
     Logical Minimum (0)                              15 00
     Logical Maximum (255)                            26 FF 00
     Physical Maximum (255)                           46 FF 00
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage (Undefined)                                09 00
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
   End Collection                                     C0
   Usage Page (Digitizer)                             05 0D
   Logical Maximum (65535)                            27 FF FF 00 00
   Report Size (16)                                   75 10
   Report Count (1)                                   95 01
   Usage (Scan Time)                                  09 56
   Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)        81 02
   Logical Minimum (0)                                15 00
   Logical Maximum (31)                               25 1F
   Report Size (5)                                    75 05
   Usage (Contact Count)                              09 54
   Report Count (1)                                   95 01
   Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)        81 02
   Report Size (3)                                    75 03
   Logical Maximum (1)                                25 01
   Report Count (1)                                   95 01
   Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)        81 03
   Report Size (8)                                    75 08
   Report ID (2)                                      85 02
   Usage (Contact Count Maximum)                      09 55
   Logical Maximum (16)                               25 10
   Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
   Usage Page (Vendor-Defined 1)                      06 00 FF
   Report ID (5)                                      85 05
   Usage (Vendor-Defined 197)                         09 C5
   Logical Minimum (0)                                15 00
   Logical Maximum (255)                              26 FF 00
   Report Size (8)                                    75 08
   Report Count (256)                                 96 00 01
   Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
End Collection                                        C0
Usage Page (Digitizer)                                05 0D
Usage (Undefined)                                     09 00
Collection (Application)                              A1 01
   Report ID (3)                                      85 03
   Usage (Stylus)                                     09 20
   Collection (Physical)                              A1 00
     Logical Minimum (0)                              15 00
     Logical Maximum (1)                              25 01
     Report Size (1)                                  75 01
     Report Count (1)                                 95 01
     Usage (Tip Switch)                               09 42
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Barrel Switch)                            09 44
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage (Eraser)                                   09 45
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage (In Range)                                 09 32
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Report Count (3)                                 95 03
     Input (Cnst,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 03
     Usage Page (Generic Desktop)                     05 01
     Unit Exponent (-2)                               55 0E
     Unit (SI Lin: Length (cm))                       65 11
     Physical Minimum (0)                             35 00
     Report Size (16)                                 75 10
     Report Count (2)                                 95 02
     Physical Maximum (2180)                          46 84 08
     Logical Maximum (1023)                           26 FF 03
     Usage (X)                                        09 30
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Physical Maximum (1370)                          46 5A 05
     Logical Maximum (1023)                           26 FF 03
     Usage (Y)                                        09 31
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
     Usage Page (Digitizer)                           05 0D
     Usage (Tip Pressure)                             09 30
     Logical Minimum (1)                              15 01
     Logical Maximum (255)                            26 FF 00
     Report Size (8)                                  75 08
     Report Count (1)                                 95 01
     Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)      81 02
   End Collection                                     C0
End Collection                                        C0
 
Looking at this, the first thing I notice is this Atmel devices is using report IDs. At least 2 of those are for top level collections.

So the first big question is whether it's actually sending data to KODI using Report ID 1 (Finger usage) or 3 (Stylus usage)?
 
Looking at this, the first thing I notice is this Atmel devices is using report IDs. At least 2 of those are for top level collections.

So the first big question is whether it's actually sending data to KODI using Report ID 1 (Finger usage) or 3 (Stylus usage)?

I am not sure about that, respectively how to check that on KODI. Is "Stylus usage" Multitouch too?
What I know is if I use the Pictures/Slideshow Function on KODI I can zoom, and rotate the Pictures with the (two) Finger - so it's recognizing Mulittouch ..
 
with Kodi, touchscreen is only working if x/y resolutions are exactly the same as the screen.

Another question:
Is the touchscreen function also working with teensy LC hardware?
 
Back
Top