Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*the following code is to print the RFID value of the card.
- we have used the Arduino Mega and put the RFID reader Tx pin in Rx1 */
- #include <SoftwareSerial.h>
- // The following is the card no. for 3 cards. You will be provided these numbers.
- String c1="29003359BBF8";
- String c2="29003358A0E2";
- String c3="2900336893E1";
- String a="";
- String s="";
- void setup()
- {
- Serial.begin(9600);
- Serial1.begin(9600);
- }
- void loop()
- {
- if(Serial1.available())
- a=a+(char)Serial1.read();
- s=a;
- if(s.equalsIgnoreCase(c1))
- Serial.println(s+" p1");
- else if(s.equalsIgnoreCase(c2))
- Serial.println(s+" p2");
- else if(s.equalsIgnoreCase(c3))
- Serial.println(s+" p3");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement