Question
please help I need Energia code for this problem Problem 4: Using an external LED and two external pushbuttons, write a sketch that performs the
please help I need Energia code for this problem Problem 4: Using an external LED and two external pushbuttons, write a sketch that performs the following.
At startup, the LED will be ON with medium brightness.
Every time button-1 is pressed, the brightness of the LED will change from MEDIUM to HIGH, HIGH to LOW and LOW to MEDIUM. You can control the brightness using pulse width modulation (PWM), or the analogWrite function.
If button-2 is pressed, the LED will turn off; if pressed again, the LED will turn on at the brightness level it had before turning off. If button-1 is pressed while the LED is off, it wont have any effect afterwards (i.e. the brightness will not change when the LED is turned ON again).
If the user types Keyboard Control in the serial monitor, both the buttons will stop working. Their functionalities will now be replaced by the serial monitor commands Change Speed, Turn ON, and Turn OFF. The buttons will resume control when the user types Button Control.
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