Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
RFIDOne = String("15001A0F3434");
RFIDtwo = String("15001A0FC0C0");
RFIDthree = String("15001A204768");
RFIDfour = String("15001A20F9D6");
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
void loop()
{
ReadCard();
ReadButton();
VerifyVoter();
lcd.setCursor(0, 0);
lcd.print(" RFID Voting System");
lcd.setCursor(0, 1);
lcd.print("TDP = ");
lcd.print(TDPvotter);
lcd.setCursor(0, 2);
lcd.print("YSRCP = ");
lcd.print(YSRCPvotter);
lcd.setCursor(0, 3);
lcd.print("BJP = ");
lcd.print(BJPvotter);
}
//---------------------------------------------------------------------------------------------------------------//---------------------------------------------------------------------------------------------------------------void VerifyVoter(){
if(votter1 || votter2 || votter3 || votter4)
{Access_Allowed_toVoting = true;}
BJPvotter++;
Serial.println(BJPvotter);
votter1 = false,votter2 = false,votter3 = false,votter4 = false;
TDP = false,YSRCP = false,BJP = false;
}
TDP = false,YSRCP = false,BJP = false;
Access_Allowed_toVoting = false;
}
//---------------------------------------------------------------------------------------------------------------//---------------------------------------------------------------------------------------------------------------void ReadButton(){
boolean Button1_Lstatus = HIGH,Button2_Lstatus = HIGH,Button3_Lstatus = HIGH;
Serial.println("TDP");
}
else if (Button_2 == LOW && Button2_Lstatus == HIGH){
digitalWrite(13, HIGH);
YSRCP = true;
//
Serial.println("YSRCP");
}
else if (Button_3 == LOW && Button3_Lstatus == HIGH){
digitalWrite(13, HIGH);
BJP = true;
//
Serial.println("BJP");
}
}
//***********************************************************************************
void ReadCard(){
if(Serial.available())// Check if there is incoming data in the RFID Reader
Serial Buffer.
{
count = 0; // Reset the counter to zero
/* Keep reading Byte by Byte from the Buffer till the RFID Reader Buffer
is
empty
or till 12 Bytes (the ID size of our Tag) is read */
while(Serial.available() && count < 12)
{
input[count] = Serial.read(); // Read 1 Byte of data and store it in
the input[] variable;
TagRFID += input[count];
count++; // increment counter
delay(5);
// Serial.print(input[count]);
}
//Serial.println();
TagRFID.trim();
//Serial.println(TagRFID);
Serial.println("votter2");
votter2 = true;
votter22 = false ;
}
}
//---------------------------------------------------------------------------------------------------------------//----------------------------------------------------------------------------------------------------------------