Chris--A / Keypad

A version of the keypad library found in Wiring. This is just a copy made compatible with the Arduino IDE library manager.
GNU General Public License v3.0
257 stars 156 forks source link

This library is incompatible with Raspberry Pi Pico (W) #47

Open mwwojcik2017 opened 12 months ago

mwwojcik2017 commented 12 months ago

As mentioned in previous issue, the macro added into Keypad.h is not working properly with INPUT_PULLUP mode - I made a test with Raspberry Pico W board. Please update library by removing this section (lines 38-54). Thank you in advance!

VkBoit commented 9 months ago

If using the Earlephilhower core on a Pico, it didn't work for me too.

I commented the entire block out and it works perfectly now. You can try it.

`// Removed the block below so that it worked for Pico /*

ifndef INPUT_PULLUP

warning "Using pinMode() INPUT_PULLUP AVR emulation"

define INPUT_PULLUP 0x2

define pinMode(_pin, _mode) _mypinMode(_pin, _mode)

define _mypinMode(_pin, _mode) \

do { \ if(_mode == INPUT_PULLUP) \ pinMode(_pin, INPUT); \ digitalWrite(_pin, 1); \ if(_mode != INPUT_PULLUP) \ pinMode(_pin, _mode); \ }while(0)

endif */`

I'm pretty sure there's a neater way to do it.