separate timers and whatnot

Again, I find myself at the mercy of you fellows here on the forum. I have a code written to read from 3 rfid readers and light an led for certain uids. It may sound simple (and it really is) but it took me forever to get it figured out with the help of some great guys on the forum. My final steps which seemed simplest to me at first, but now seem most difficult, are to create an 8-hour timer triggered by a button press (it will be pressed by the triggered action of the previous 8-hour timer) that triggers a servo, change my led to three separate servos (one for each reader) and change a delay to millis (should be simple, but apparently I’m simpler). I guess I need help even getting started. I haven’t really attempted the timer or button or servo triggered by the timer or replacing my one led with three separate servos. I’ve tried to replave delay with millis with no success. Any help would be greatly appreciated. Thanks!

here’s my code so far.

#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>

#define SS1_PIN 10
#define SS2_PIN 4
#define SS3_PIN 8
#define RST_PIN 9
#define redLed 7

MFRC522 readerOne(SS1_PIN, RST_PIN);
MFRC522 readerTwo(SS2_PIN, RST_PIN);
MFRC522 readerThree(SS3_PIN, RST_PIN);

void setup() {
  pinMode(redLed, OUTPUT);
  pinMode(redLed, OUTPUT);
  SPI.begin();
  readerOne.PCD_Init();
  readerTwo.PCD_Init();
  readerThree.PCD_Init();
}
       
  int myCat = 0x03;  
  int yourCat = 0xF3;
  int readTagOne;
  int readTagTwo;
  int readTagThree; 
  
void loop() { 
  
  if (readerOne.PICC_IsNewCardPresent()){
     readerOne.PICC_ReadCardSerial();
     readTagOne = (readerOne.uid.uidByte[0]);  
        if(readTagOne == myCat){  
        digitalWrite(redLed, HIGH); 
        delay(1800);
        digitalWrite(redLed, LOW);}
     else{   
        if(readTagOne == yourCat){  
        digitalWrite(redLed, HIGH); 
        delay(1800);
        digitalWrite(redLed, LOW);
      }
      }
      }        
      
  if (readerTwo.PICC_IsNewCardPresent()){
     readerTwo.PICC_ReadCardSerial();  
       readTagTwo = (readerTwo.uid.uidByte[0]);
        if(readTagTwo == myCat){  
        digitalWrite(redLed, HIGH); 
        delay(1800);
        digitalWrite(redLed, LOW);}
     else{   
        if(readTagTwo == yourCat){  
        digitalWrite(redLed, HIGH); 
        delay(1800);
        digitalWrite(redLed, LOW);
      }
      }
      }      
      
   if (readerThree.PICC_IsNewCardPresent()){
     readerThree.PICC_ReadCardSerial(); 
       readTagThree = (readerThree.uid.uidByte[0]); 
        if(readTagThree == myCat){  
        digitalWrite(redLed, HIGH); 
        delay(1800);
        digitalWrite(redLed, LOW);}
     else{   
        if(readTagThree == yourCat){  
        digitalWrite(redLed, HIGH); 
        delay(1800);
        digitalWrite(redLed, LOW);
      }
      }
      }
 }

Have you looked at the blink without delay example in the IDE?

Also, this

I have. I just can't apply it to mine. I'm not saying it's not there to see. I just don't have that ability at the current moment. The blink without delay is a continuous loop that never starts or stops, so I don't know how to apply it to making a servo hold a position for a certain time only when triggered by the rfid reader.

I've looked at the other link as well. I'll look over it more, but I think my general lack of knowledge in this area makes it near impossible for me to apply examples that aren't very similar to my application.

Thanks

I know it is only a link to more reading but the Thread Planning and Implementing a Program may help you to think about your project in small pieces that can fit into the several things at a time format.

I think it will also help if you separate (in your mind and in your code) the business of reading your RFID tags (and saving their values) from the business of acting on the values.

Your loop() should probably be as simple as this

void loop() {
   currentMillis = millis(); // assumes you want to time something
   readRFIDs();
   lightLEDs();
   // etc
}

Spending some time now to become familiar with this way of organizing your code (even at the expense of putting your project to one side for a day or two) will repay the effort many times over.

...R

I don't know how to apply it to making a servo hold a position for a certain time only when triggered by the rfid reader.

Some pseudo code to give you some ideas

start of loop()
  if RFID code has been read and verified
    move the servo to angle X
    save startTime from millis()
  end if
  
 if millis() - startTime >= interval
   move the servo to angle Y
 end if

 //any other code that does not block goes here and is independant of the timing
end loop()