Question: 3. Assume the one switch input (SW1) and the two LEDs (LED1, LED2). Both LEDs should be initially off. After each press and release
3. Assume the one switch input (SW1) and the two LEDs (LED1, LED2). Both LEDs should be initially off. After each press and release of SW1, change the LED state (LED1/LED2) in the sequence: ON/ON, ON/OFF, OFF/ON, and then back to OFF/OFF. a) Draw the state machine of the design that changes LED states. b) Draw the state machine of the design that controls SW1. c) If the voltage drop across the LED = 1.3 V and the maximum allowed current is 4 mA, what is the minimum value of the resistance that is connected to the LEDs? d) Draw the schematic diagram of the design (use PIC24HJ32GP202) e) Write the C source code for the design (you may use the macros and the inline functions that you defined in question 1).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
