Theaimofthegameistoclickonthebuttonwhen thebluelightisswitched ON.
If you are successful, the RGB LED shows the colour red and the difficulty increases. On the other hand, if you fail, the difficulty decreases and the RGB displays the colour red.
How It WorksEach LED continuously switches between ON and OFF one at a time. A timer is added to delay this process and give the illusion of movement. When the blue LED is switched on and the button is clicked, we reduce the subsequent time for delays (This gives the illusion of the light moving faster) and the RGB LED displays the colour green. Where the button is clicked when an LED other than the blue light is switched on the delay is decreased(This gives the illusion of the light moving slower) and the RGB LED displays the colour Red. These mechanics can be seen as game levels where if you succeed the game gets harder and if you fail it gets easier.
Arduino RGB LED Circuit Diagram- Connect 4 green LEDs and a white LED to digital pins, add a resistor and connect to ground
- wire a button from 5 volts to ground and attach to a digital pin
- add an RGB LED to the circuit, if unsure how to do this, refer to this link: https://create.arduino.cc/projecthub/muhammad-aqib/arduino-rgb-led-tutorial-fc003e
Comments