I'm working a project using Arduino Mega 2560, LCD Keypad Shield, and RFID 13,56 MHz MF522 module.
The problem is that the LCD Keypad shield and RFID MF522 are using pin 5 together, so I changed RFID pin to the other digital pin (I'm using pin 31 now). But when I initialize the RFID and LCD shield, the LCD is not working. When I don't initialize the RFID, the LCD shield working well.
I'm using the LiquidCrystal library for the LCD, and RFID library made by Miguel Balboa (circuitito.com) based on code by Dr.Leong (www.b2cqshop.com).
Here's some simple code I've made :
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
RFID rfid(53,31); //when init RFID, pin 5 changed to 31
void setup()
{
Serial.begin(9600);
analogWrite(10, 50); // set brightness on pin 10 to 0-255
lcd.begin(16, 2); // start the library
rfid.init(); //when RFID init, LCD not working
}
void loop()
{
lcd.setCursor(9,1); // move cursor to second line "1" and 9 spaces over
lcd.print(millis()/1000); // display seconds elapsed since power-up
}
Any suggestion to make the LCD shield work together with the RFID module? Or am I doing something wrong?
Note : I've tried using just the RFID using pin 31 without init the LCD, and the RFID is working well.