Touchscreen does not work with RAW HID

Status
Not open for further replies.

rdm

New member
If you want to use the touchscreen with the RawHID function, it doesn't work.

Code is the slightly adapted Teensy "Single Finger Line Example"

Code:
elapsedMillis nextTouch;

void setup() {
TouchscreenUSB.begin();
}

void drawline(int x, int y) {
for (int i=0; i < 6000; i += 100) {
TouchscreenUSB.press(0, x + i, y + i/13);
delay(10);
}
TouchscreenUSB.release(0);
}

void loop() {
if (nextTouch>1000) {
nextTouch=0;
Serial.println("press");
drawline(16000, yoffset);
yoffset += 1200;
if (yoffset > 24000) yoffset = 4000;
}
}

If you select USBType "Keyboard + Touchscreen" or "Keyboard + Mouse + Touchscreen" it works.

With the USB type "All of the Above" or a custom type with RAWHID and Touchscreen, the program apparently crashes after two USB packets.
You can see that on the serial monitor, which always resets

Does anyone happen to know the problem and have a solution?

I am using Teensyduino version 1.53. with a Teensy 3.2 on OSX 10.14 and Windows10
It doesn't work in 1.54 Beta # 9 either.
Optimize: Fast, Faster and Debug

I've already reported an issue on Github
https://github.com/PaulStoffregen/cores/issues/563

greetings
Lars
 
Doesn't it happen that someone has an idea or a clue what it might be?

Or does anyone have experience with the USB touchscreen library?

I would be very grateful for a tip on where to start.

greetings
Lars
 
Status
Not open for further replies.
Back
Top