Tuesday, 28 May 2013

RFID MF522 13,56 MHz and LCD Keypad Shield Arduino Issue in Arduino Mega 2560

RFID MF522 13,56 MHz and LCD Keypad Shield Arduino Issue in Arduino Mega 2560

I'm working a project using Arduino Mega 2560, LCD Keypad Shield (http://www.dfrobot.com/wiki/index.php?title=Arduino_LCD_KeyPad_Shield_%28SKU:_DFR0009%29), and RFID 13,56 MHz MF522 module.
The problem is the LCD Keypad shield and RFID MF522 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 not working. When I'm not initialize the RFID, LCD shield working well.
I'm using LiquidCrystal library for the LCD, and RFID library made by Miguel Balboa (circuitito.com) based on code 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
 ClearMenu();
 PrintMenu();
 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 can work together with RFID module? Or I'm doing something wrong?

No comments:

Post a Comment