Answered step by step
Verified Expert Solution
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 statemachine program structure that will act as a Neopixel Ledring driver.
Task p
Interface with a pushbutton as an interrupt. Within the interrupt handling subroutine increment a press counter, and depending on the value of this counter, select the next mode.
Task
Implement a state machine structure inside the main LOOP. Inside the states, only call the corresponding function.
Task
Express the function "blink int ; In this function, all the pixels should turn RED, and perform a simultaneous turnon and turnoff sequence with a delay defined as
Task
Express the function "runningLight int d bool dir; The LEDring 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.
Task p
Express the function "breathe int d; All the pixels on the ring should display a breathinglike effect in GREEN. Each LED's brightness should increment, then decrement.
Task
Express the function "randomLight int d; On the ring a randomly chosen LED pixel should turn on and stay appeared until a given time.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started