Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions