Hacker News new | ask | show | jobs
by sk0g 2221 days ago
Would Numpy be of use? Haven't looked at the source yet, but for a keyboard, 4 ms per matrix would be noticeably laggy, especially if you add debouncing (is that even a thing in keyboards?)
3 comments

It's a microcontroller. It has maybe 512k of storage and 128k of memory. The Numpy package probably is ~100Mb

The controller is running CircuitPython which is a fork of MicroPython - a tiny re-implementation Python for microcontrollers.

Valid point! Might still be able to get a speed up if you can write and import your own C code though.
The best usb keyboard should have 1ms latency due to USB HID interrupt interval. 4 ms is not that bad.
Yeah, read it as 4ms per row at first. Should be fine for general use, and rather impressive as is :)
How would 4ms be noticeably laggy?
I read it first as 4ms per row, but yeah 4ms per scan wouldn't be too bad. There is of course additional time taken for communication etc, which might take another 4-10ms, which could make it almost a frame behind. Not terrible still.