LED Pattern 3 with ATmega16
In this project, we will learn How to generate different patterns in a 1×8 LED array with AVR ATmega16 microcontroller. First, we will connect the 8 LEDs with 8 pins of any port of the ATmega16 microcontroller. Then, we will generate the below pattern in the 1×8 LED array. The pattern is shown in below diagram:
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
LED Position |
x |
x |
x |
x |
x |
x |
x |
x |
Initial State of LEDs |
* |
x |
x |
x |
x |
x |
x |
x |
2nd State of LEDs |
* |
* |
x |
x |
x |
x |
x |
x |
3rd State of LEDs |
* |
* |
* |
x |
x |
x |
x |
x |
4th State of LEDs |
* |
* |
* |
* |
x |
x |
x |
x |
5th State of LEDs |
* |
* |
* |
* |
* |
x |
x |
x |
6th State of LEDs |
* |
* |
* |
* |
* |
* |
x |
x |
7th State of LEDs |
* |
* |
* |
* |
* |
* |
* |
x |
8th State of LEDs |
* |
* |
* |
* |
* |
* |
* |
* |
Final State of LEDs |
In the above diagram, * means LED is on and x means LED is off. The time interval between each state is 500ms and the above pattern continues forever.
Softwares Required
Hardwares Required
Name | Quantity |
![]() |
1pc |
![]() |
1pc |
![]() |
1pc |
![]() |
2pc |
Post a Comment