MICROCONTROLLERS cs
Learning Goal: I’m working on a electrical engineering question and need support to help me learn.
1-Write an AVR program that simulates manually operated traffic lights at a pedestrian crossing. Until no button is pressed a green LED is lit for the cars. After pressing a pushbutton (PA5) the green LED (PC4) will start to blink for 3 seconds with 1 second total delay time for every blink, this is followed by blinking the yellow LED (PC3) for 3 seconds with 0.5 second total delay time for every blink and then the red LED (PC2) will blink for 10 seconds with 1 second total delay time for every blink. When the red LED is on, the 7-segment display (port B) countdowns seconds from 9 to 0 with 1 second time delay for every digit. Use an array to store the digits of the 7-segment display in hexadecimal values.
2-With the AVR ATmega16 microcontroller, a circuit has a servomotor (PC0), three pushbuttons, two LEDs, and a 7-segment. Write a program as when the PB2 pushbutton is pressed the servomotor will rotate 90 degrees and the first LED (PA0) will be on. When the PB3 pushbutton is pressed the servomotor will rotate 180 degrees and the second LED (PA1) will be on. When the PB1 pushbutton is pressed the 7-segment will display a pattern from A to F with a 500 ms delay for every digit. Use an array to store the digits of the 7-segment display in binary format.
3-Using an AVR microcontroller, a circuit has a servomotor (PA0), two pushbuttons, and two LEDs. Write a program as when the PB0 pushbutton is pressed the servomotor will rotate clockwise and the first LED (PD0) will be on. When the PB1 pushbutton is pressed the servomotor will rotate counterclockwise and the second LED (PD1) will be on.