ArduinoGeneral

LED Keypad Shield

userHead Account cancelled 2018-02-23 21:51:10 882 Views0 Replies
Hello,

I was using the LED keypad Shield with some students and i was interested to use these shields with other boards than the
Arduino UNO.

So i make some modification in the source code of the library.
In the header file LedKeypad.h, you can change these lines :
***********
private:
#define SCL_pin 19
#define SDA_pin 18
**********
by these one

*****************
private:
#if defined(ARDUINO_AVR_MEGA)
#define SCL_pin 21
#define SDA_pin 20
#elif defined(ARDUINO_AVR_MEGA2560)
#define SCL_pin 21
#define SDA_pin 20
#elif defined(ARDUINO_AVR_UNO)
#define SCL_pin 19
#define SDA_pin 18
#elif defined(ARDUINO_AVR_ETHERNET)
#define SCL_pin 19
#define SDA_pin 18
#elif defined(ARDUINO_AVR_LEONARDO)
#define SCL_pin 3
#define SDA_pin 2
#endif
**************************************

Then the shield works perfect on UNO, MEGA2560, Leonardo Board ...

I just take into account these boards. I have some samples of these models.

If this can help somebody ...

Have fun

Manuel