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
Get step-by-step solutions from verified subject matter experts
