Question: Write a program using state - machine program structure that will act as a Neopixel Led - ring driver. Task ( 2 0 p )

Write a program using state-machine program structure that will act as a Neopixel Led-ring driver.
Task (20p)
Interface with a push-button as an interrupt. Within the interrupt handling subroutine increment a press counter, and depending on the value of this counter, select the next mode.
2. Task(20p)
Implement a state machine structure inside the main LOOP. Inside the states, only call the corresponding function.
3. Task(15p)
Express the function "blink (int d);". In this function, all the pixels should turn RED, and perform a simultaneous turn-on and turn-off sequence with a delay defined as "d".
4. Task(15p)
Express the function "runningLight (int d, bool dir);". The LED-ring should play an effect, that only a singte pixel is alit in RED, and it appears to be circling around the ring. Depending on the "dir" direction argument, it should "run" clockwise or counterclockwise.
5. Task (15p)
Express the function "breathe (int d);". All the pixels on the ring should display a breathing-like effect in GREEN. Each LED's brightness should increment, then decrement.
6. Task(15p)
Express the function "randomLight (int d);". On the ring a randomly chosen LED pixel should turn on and stay appeared until a given time.
 Write a program using state-machine program structure that will act as

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!