1int RfidInputPin =3;// set the pin that the rfid is connected2int RfidTrigger;// variable to save the state of the pin34voidsetup(){5 Serial.begin(9600);6// set pin 3 as INPUT7pinMode(RfidInputPin, INPUT);8}910voidloop(){11// read the state of pin 312 RfidTrigger =digitalRead(RfidInputPin);13// if the state is HIGH then print RFID ON14if(RfidTrigger == HIGH){15 Serial.println("RFID ON");16}17// if the state is HIGH then print NO RFID 18else{19 Serial.println("NO RFID");20}21// read every 100ms22delay(100);23}