Hi everyone, for one of my projects i am currently working with an RFID scanner. So i had this idea to turn on a green led if the correct card was put on the scanner and a red led for the wrong card. I also wanted to add a blue led which would work as an alarm (blinking) if the wrong card was put on.
But i seem to get the alarm not working corectly, is there someone who can help me with the alarm? (it also needs to be turned of if the correct card is scanned.
this is the code for the leds i got already:
if (strID.indexOf("23:6B:DF:3E") >= 0)
{
digitalWrite(LED_PINGREEN, HIGH);
digitalWrite(LED_PINRED, LOW);
Serial.println("Dit is het goede kaartje"); //right card
}
else if(currentMillis - previousMillis >= interval){
previousMillis = currentMillis;
digitalWrite(LED_PINRED, HIGH);
digitalWrite(LED_PINGREEN, LOW);
Serial.println("Dit is niet het goede kaartje er komt over: "); //wrong card
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
digitalWrite(LED_PINALARM, ledState);
}