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

Thread: Gaming keyboard with Teensy 2.0

  1. #1
    Junior Member
    Join Date
    May 2018
    Posts
    1

    Gaming keyboard with Teensy 2.0

    Hey guys,

    i want to built a gaming keyboard and I already ordered a teensy 2.0 and Cherry MX switches. I know that the polling rate (125 - 1000 hz) is important, but which rate will i have with my teensy?

    Thanks in advance!

    Regards

  2. #2
    Junior Member
    Join Date
    May 2018
    Posts
    3
    Hey Leeman,

    your polling rate will depend on the way you wire up your switches and how you code the polling.
    I would not worry too much about that now. I built a Midi Keyboard with 44 Keys, using an Arduino Leonardo (also a 32u4 chip, like the Teensy 2). I wrote a rather simple program using two nested for loops and digitalRead() and digitalWrite(), and I did not notice any Latency.
    I would start by building a test circuit with just a few switches and similar simple code and test how fast it is. If it is too slow for you, then you can optimize your code, e.g. by manipulating the port registers directly.

    Regards, Flophi

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,294
    In addition to the rate you implement for reading all your buttons, there is the USB polling interval. On Teensy the default is 1 ms, which is the shortest interval possible with 12 MBit/sec USB. It can be edited in the usb code, if you want to go slower.

Posting Permissions

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