Open eMUQI opened 1 year ago
I also had this problem, and when I implemented and tested the scanKeys() function of the library directly in main.c, the problem disappeared.
However, when we added #include
// bperrybap - Thanks for a well reasoned argument and the following macro(s). // See http://arduino.cc/forum/index.php/topic,142041.msg1069480.html#msg1069480
// #define pinMode(_pin, _mode) _mypinMode(_pin, _mode) <<--- UNO R4 error
do { \ if(_mode == INPUT_PULLUP) \ pinMode(_pin, INPUT); \ digitalWrite(_pin, 1); \ if(_mode != INPUT_PULLUP) \ pinMode(_pin, _mode); \ }while(0)
` When I modified it as above, it worked normally. The above macro is not working properly on UNO R4, and it seems to interfere with pull-up functionality.
+If the error still occurs, you need to comment out the entire macro.
Hello,
I have the same issue with Giga but there was some helpfull info: Change Keypad.h:
to:
It works for me.
I also had this problem, and when I implemented and tested the scanKeys() function of the library directly in main.c, the problem disappeared.
However, when we added #include
, the same problem occurred, and it is confirmed that the problem occurred in the macro part of the header below. ` Keypad.h // bperrybap - Thanks for a well reasoned argument and the following macro(s). // See http://arduino.cc/forum/index.php/topic,142041.msg1069480.html#msg1069480 #ifndef INPUT_PULLUP #warning "Using pinMode() INPUT_PULLUP AVR emulation" #define INPUT_PULLUP 0x2 // #define pinMode(_pin, _mode) _mypinMode(_pin, _mode) <<--- UNO R4 error #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
` When I modified it as above, it worked normally. The above macro is not working properly on UNO R4, and it seems to interfere with pull-up functionality.
+If the error still occurs, you need to comment out the entire macro.
Thanks @nyk-yeon, this solved the problem I had with the R4 Wifi. Its suprising that a year after you identified the bug/solution the libraries haven't been updated or fixed. This issue is still plaging users of that keypad as of May 5, 2024.
Has anyone tried using this library on the Uno R4 board? I attempted to use the code below, but the data obtained was very unstable and the serial monitor kept printing 1. Although there was a response when pressing the button, it cannot be used for practical applications on the R4 board.