Thank for your suggestion...
Now im able to make the rfid and lcd function as i want it,
But still have 1 more thing,
-How do i make the scan card/tag clear after a period of time with out clearing all the display??
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
#define rxPin 2
#define txPin 3
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
SoftwareSerial RFID = SoftwareSerial(rxPin, txPin);
char code[20];
int val = 0;
int bytesread = 0;
int led = 13;
void setup()
{
Serial.begin(9600); //open serial hardware
RFID.begin(9600); //open serial software
pinMode(rxPin, INPUT); //set pin on arduino for receiving RFID data
pinMode(txPin, OUTPUT); //this is not important
pinMode(led, OUTPUT);
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print(" WELCOME TO JKE ");
lcd.setCursor(0,1);
lcd.print(" KEY SYSTEM ");
delay (5000);
lcd.clear(); //Clears LCD
lcd.setCursor(0,0);
lcd.print(" TOUCH CARD/KEY ");
}
void loop()
{
val = 0;
bytesread = 0;
while(bytesread < 12)
{
// read 12 digit code
val = RFID.read();
if(val == 3)
{
break;
}
if(val != 2)
{
code[bytesread] = val; // add the digit
bytesread++; // ready to read next digit
code[bytesread] = '\0'; // add the NULL
}
}
if(bytesread >= 12)
{ // if 12 digit read is complete
Serial.print(" ");
lcd.setCursor(0,1);
lcd.print(" ");
for(int i=0; i<bytesread; i++)
{
Serial.print(code[i]);
lcd.print(code[i]);
}
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
}
}
Please tesch or instruct me on how to do it... thanks...