I'm still not getting millis(). a little help?

I'm trying to switch out my all my delays for millis but It's just not working for me. I see all over to look at the blimk without delay example, and I have it up next to my sketch, but I'm just not getting it.

here's my code

/* MOSI: Pin 11 / ICSP-4
 * MISO: Pin 12 / ICSP-1
 * SCK : Pin 13 / ICSP-3
 * SS : Pin 4,8,7 (Configurable)
 * RST : Pin 9 (Configurable)
 */
                               
#include <SPI.h>
#include <MFRC522.h>
#include <VarSpeedServo.h>
                               
#define SS1_PIN 4
#define SS2_PIN 7
#define SS3_PIN 8
#define RST_PIN 9
//#define redLed 7

VarSpeedServo feeder;
VarSpeedServo cover1;
VarSpeedServo cover2;
VarSpeedServo cover3;

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

long coverDuration = 20;
long closeTime = 0;

void setup() {
  //pinMode(redLed, OUTPUT);
  SPI.begin();
  readerOne.PCD_Init();
  readerTwo.PCD_Init();
  readerThree.PCD_Init();
  feeder.attach(10);
  feeder.write(0,255,true);
  cover1.attach(3);
  cover1.write(0,255,true);
  cover2.attach(5);
  cover2.write(0,255,true);
  cover3.attach(6);
  cover3.write(5,255,true);
}
       
  int myCat = 0x03;  
  int readTagOne;
  int readTagTwo;
  int readTagThree; 
  
void loop() { 
  
  unsigned long currentMillis1 = millis();
  
  if (readerOne.PICC_IsNewCardPresent()){
     readerOne.PICC_ReadCardSerial();
     readTagOne = (readerOne.uid.uidByte[0]);  
        if(readTagOne == myCat){
            cover1.write(160,255,false);
            closeTime = currentMillis1;            
            if(currentMillis1 - closeTime > coverDuration) {
            cover1.write(0,255,true);
            }
        }  
  }        
      
  if (readerTwo.PICC_IsNewCardPresent()){
     readerTwo.PICC_ReadCardSerial();  
       readTagTwo = (readerTwo.uid.uidByte[0]);
        if(readTagTwo == myCat){
          cover2.write(140,255,true);
          delay(2000);
          cover2.write(0,255,true);
        }
  } 
      
   if (readerThree.PICC_IsNewCardPresent()){
     readerThree.PICC_ReadCardSerial(); 
       readTagThree = (readerThree.uid.uidByte[0]); 
        if(readTagThree == myCat){
          cover3.write(160,255,true);
          delay(2000);
          cover3.write(0,255,true);
        }
   }
}

here is the specific part I want to use the millis and my current attempt.

unsigned long currentMillis1 = millis();
  
  if (readerOne.PICC_IsNewCardPresent()){
     readerOne.PICC_ReadCardSerial();
     readTagOne = (readerOne.uid.uidByte[0]);  
        if(readTagOne == myCat){
            cover1.write(160,255,false);
            closeTime = currentMillis1;            
            if(currentMillis1 - closeTime > coverDuration) {
            cover1.write(0,255,true);
            }
        }  
  }

Any help would be greatly appreciated.

Thanks

Here is my train of thought on the issue:

move servo
define current time, a
If (new current time, b) - (previously defined, a) => (a defined duration)
Then move the servo back.

Am I way off base with this thinking or what?

nevermind. I'm just an idiot. got it

Your loop function must start by checking if it is time to do anything, in your case the writing of ( 0,255,true ).
If not then go on to check the card. If you find one do the writing and in place of the dealy define the time you want to do that writing. So next time round the loop it checks if it is time to do that 0,255,true.

Implement it for one card and when it is working do it for all cards.

closeTime = currentMillis1;            
            if(currentMillis1 - closeTime > coverDuration) {

This can't work because you have created closeTime to be exactly the same as currentMillis1

Think of it this way.

currentMillis always represents the time now

it needs to be compared with an earlier time - for example the time when you switched on the toaster. I can't figure from your example what "closeTime" is supposed to represent.

The demo several things at a time is an extended example of using millis() for timing.

...R

...R