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.
- When the LDR is covered again after 15 min, the timer resets, LED returns to green and the motor switches off/remains off.
- 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.