Using a vibration motor and rgb led as a signalling system

Hi! Arduino newbie here.

I’m working with my group to prototype a product that will signal to a computer user to take a break at certain points in time using lights (LED) and a vibration motor. My group has been given a Bluno Nano and a breadboard.

I understand that Arduino has a particular time of timer that measures in milliseconds and this is a very important part of my groups project, which does the following:

An LDR will be covered first (time t=0). The RGB led will change colour as time passes from t=0: green (<3.5h), yellow (3.5-4h) and red (>4h). The vibration motor will also switch on when time elapsed exceeds 4h.

In addition to that, when the LDR is uncovered, it gets a bit trickier.

  1. When the LDR is covered again after 15 min, the timer resets, LED returns to green and the motor switches off/remains off.
  2. When the LDR is covered WITHIN 15min, the timer does not pause or reset and continues timing like usual.

I did a fair bit of research online and got pretty overwhelmed by the huge amount of information. For the timing part, I’m aware of the millis and previousmillis code, but can’t really distinguish it from delay. And since I’m using an RGB led, and I know i can get yellow by switching on the red and green led, how can I code for specific colours to happen at specific timings?

Would really appreciate any guidance about how i can code for the above. of course, I can provide a lot more detail to explain better.

delay() shuts down basically everything on the Arduino. It's like you covering your eyes and ears and counting to 1000. Then you open your eyes after that and free your hands to do useful things.

Most programs don't do that. You need it to respond to inputs during the 3.5-hour timing period. You look at the clock regularly to see if 3.5 hours has passed but that doesn't stop you doing things with your hands and looking at other inputs.

Remember the Arduino never gets bored. It can look at the clock 10,000 times per second and never gets sick of saying "Are we there yet?"

Oh, I see... Looks like I won't be using delay in my code then.

In that case, how can I use millis and previousmillis to switch on the LED and motor at different timings? And how to basically reset the timers when the LDR-reveal time exceeds 15min?