Espruino site provides a nice, lean example for driving a KeyPad Matrix. Code is lean, pin usage is pretty fat: 8 pins: 4 for columns and 4 for rows.
For applications where pins become a shortage and I2C, SPI, OneWire,... become a great and efficient tool to drive peripherals, MicroChips PortExpander MCP23017 / Datasheet with version for 16-bit / 2 x 8-bit (and MCP2308 - 8-bit) come in handy - see pic of breadboard setup.
Espruino provides an easy to use MCP23017.js module and application example MCP23xxx I2C and SPI port expanders. The provided module though just supports simple input and output - nicely emulating the single bit / one pin Port approach.
The existing module works fine for certain types of inputs and outputs, but for scanning for example a 4x4 or even 8x4 key pad, a lot of code has to be executed at a decent rate which eats away a lot of computing power and let's the application feel sluggish... If for sure may work but raises the question how to do it more efficient with, for example, .setWatch() (see conversation).
The wiring follows the sketching found above conversation. How it looks tangible is shown in attached pic. The code is subject to following posts.
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.
Espruino site provides a nice, lean example for driving a KeyPad Matrix. Code is lean, pin usage is pretty fat: 8 pins: 4 for columns and 4 for rows.
For applications where pins become a shortage and I2C, SPI, OneWire,... become a great and efficient tool to drive peripherals, MicroChips PortExpander MCP23017 / Datasheet with version for 16-bit / 2 x 8-bit (and MCP2308 - 8-bit) come in handy - see pic of breadboard setup.
Espruino provides an easy to use MCP23017.js module and application example MCP23xxx I2C and SPI port expanders. The provided module though just supports simple input and output - nicely emulating the single bit / one pin Port approach.
The existing module works fine for certain types of inputs and outputs, but for scanning for example a 4x4 or even 8x4 key pad, a lot of code has to be executed at a decent rate which eats away a lot of computing power and let's the application feel sluggish... If for sure may work but raises the question how to do it more efficient with, for example,
.setWatch()
(see conversation).The wiring follows the sketching found above conversation. How it looks tangible is shown in attached pic. The code is subject to following posts.
...to be continued...
2 Attachments