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

Thread: Teensy 4, Micro- CurcuitPython & acting as Touchscreen

  1. #1
    Junior Member
    Join Date
    Jan 2021
    Posts
    1

    Teensy 4, Micro- CurcuitPython & acting as Touchscreen

    Hi folks!

    After many years of Arduino- and ESP-tinkering the Teensy found its way in my cave.
    Now i have my first project which will have as heart the Teensy 4.0. Especially the possibility to emulate a touchpad with this one appealed to me.

    Rough key data on what I intend to do:

    PC send graphical data to a RaspberryPi on which Python will analyze them with OpenCV.
    Based on the analyzed data the Python-Script will send data through Serial to the Teensy.
    This Teensy is connected via Serial to the RasPi and via USB to the PC.
    The data comming from RasPi-Serial will evaluated by the Teensy and then it send some Keyboard/Mouse-commands to the PC.

    The part with analyzing the graphical data from PC on RasPi is mostly done, as well the sending data through Serial to [a microcontroller].

    Now I would like to use python (in whatever form, Micro- or Circuit) to program the Teensy, but i don't know if i can access the function there to send mouse inputs absolutely based on the resolution of the PC-Monitor. (FYI: PC is running Windows 10)
    Under Teensyduino this is possible without any problems, as Paul shows in this video.

    For CircuitPython i only could find libraries for working _with_ touchscreens not acting _as_ a touchscreen.
    Or did I search the wrong haystack?
    Maybe someone knows a library that can be used under python to emulate a touchscreen with the Teensy and could point me in the right direction.

    Thanks in advance and stay save!

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,962
    What you want is the USB HID touchscreen support. See this demo Paul posted in 2018:


    Note, you would need to program the Teensy using the Arduino interface (i.e. C++ with simplifications) and not CircuitPython, unless somebody has added the CP support for USB devices.

Posting Permissions

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