Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Touchscreen does not work with RAW HID

  1. #1
    Junior Member
    Join Date
    Jun 2021
    Posts
    2

    Touchscreen does not work with RAW HID

    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

  2. #2
    Junior Member
    Join Date
    Jun 2021
    Posts
    2
    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •