Keypad status for ESP32? #7472
Replies: 1 comment
-
Posted at 2023-05-22 by @gfwilliams Also posted as an issue on GitHub: espruino/EspruinoDocs#691 Posted at 2023-05-22 by chris.willing Sorry about posting there as well and since it is closed, progress here. Firmware was originally 2v17.118_esp32 but updated now to latest 2v17.120_esp32. Your tip about use of The callback version is still a problem although there was some progress after fixing those loops, since pinMode() and setWatch() were being fed with strings rather than numbers. With some added I tested the same pins separately with a mechanical switch e.g.
and it works fine for all the pins being used for the keypad. Nevertheless, still no luck with the keypad itself. More digging needed and any help appreciated ... Posted at 2023-05-24 by @gfwilliams Thanks - well that's an odd one. What happens if you do:
... so swapping the two around? It's possible that on ESP32 setting the pin mode disables the watch somehow when it shouldn't? Posted at 2023-05-24 by chris.willing I updated firmware to 2v18.1_esp32 today. Unfortunately no change swapping those calls around. In fact I can remove pinMode() altogether for the extra button and it still works. Posted at 2023-05-25 by chris.willing Could the problem have something to do with the keypad type? I ran the following code:
where the first 3 pins are connected to column outputs of 4x3 membrane type keypad and last pin is connected to a single mechanical switch. The first three watches never trigger a callback whereas the last one always triggers the callback. I separately tried the mechanical switch on all of three pins used above for the 4x3 keypad columns and the mechanical switch triggered the callback every time. This all leads me to suspect something about the keypad itself. It's the same style as the first shown in the Espruino KeyPad Matrix page. I've tried both a 4x4 and a 4x3, both of which work using the plain |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-05-21 by chris.willing
I'm trying to use the keypad module without success. The recommended:
is never called back.
I also tried
and printed output of
keypad.read()
in a while loop. This produced output like 38 28 08 312 212 012 etc. depending on the key pressed.I tested the same keypad using the same pin connections on the same device in an arduino sketch where it worked perfectly.
Anyway, since there was at least some output, I was going to start hacking on the source code but in the meantime, is anyone using a keypad successfully?
Thanks for any pointers ...
Beta Was this translation helpful? Give feedback.
All reactions