Keypad icon indicating copy to clipboard operation
Keypad copied to clipboard

This library is incompatible with Raspberry Pi Pico (W)

Open mwwojcik2017 opened this issue 1 year ago • 1 comments

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!

mwwojcik2017 avatar Nov 20 '23 15:11 mwwojcik2017

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.

VkBoit avatar Feb 02 '24 06:02 VkBoit