I get fully handled button down-up sequences (pressTimes) done in less than 20ms... without loading the system with scanning... it all depends how shortly you can press the button and how you set the optional debounce and upcheck times (there is even room in the 'button definitively up' check mechanism that could shorten the times even more... and the I2C communication runs on the slowest bitrate: 100K (it can be up to 1.7M, with SPI up to 10MHz, but requires solid wiring... breadboard connection quality and related wiggle on key presses gave me I2C timeouts... ;(...
My scan to decode the col at interrupt event has average of two (2) - half the number of cols - I2C writes/reads - 2 writes and 1 read - with a 1 bit shift and 3 comparison (includes the loop checks)... and this all in Espruino JS. Even if you keep the polling architecture for input in your app as I showed with the
ciao Arduino
application example, you gain a lot not wasting all this scanning when nothing happens AND gain responsiveness in your application.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Really? 150ms,...
I get fully handled button down-up sequences (pressTimes) done in less than 20ms... without loading the system with scanning... it all depends how shortly you can press the button and how you set the optional
debounce
andupcheck
times (there is even room in the 'button definitively up' check mechanism that could shorten the times even more... and the I2C communication runs on the slowest bitrate: 100K (it can be up to 1.7M, with SPI up to 10MHz, but requires solid wiring... breadboard connection quality and related wiggle on key presses gave me I2C timeouts... ;(...My scan to decode the col at interrupt event has average of two (2) - half the number of cols - I2C writes/reads - 2 writes and 1 read - with a 1 bit shift and 3 comparison (includes the loop checks)... and this all in Espruino JS. Even if you keep the polling architecture for input in your app as I showed with the
application example, you gain a lot not wasting all this scanning when nothing happens AND gain responsiveness in your application.