Created
June 4, 2017 07:26
-
-
Save prasant1010/5e93c61360fc42915a0c3b98a7e7da8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define F_CPU 1000000UL | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) | |
{ | |
DDRC = 0xFF; // Configure PORTA as output | |
while(1) | |
{ | |
PORTC = 0b00111111; // Display Number 0 | |
_delay_ms(1000); // Wait for 1s | |
PORTC = 0b00000110; // Display Number 1 | |
_delay_ms(1000); // Wait for 1s | |
PORTC = 0b01011011; // Display Number 2 | |
_delay_ms(1000); // Wait for 1s | |
PORTC = 0b01001111; // Display Number 3 | |
_delay_ms(1000); // Wait for 1s | |
PORTC = 0b01100110; // Display Number 4 | |
_delay_ms(1000); // Wait for 1s | |
PORTC = 0b01101101; // Display Number 5 | |
_delay_ms(1000); // Wait for 1s | |
PORTC = 0b01111101; // Display Number 6 | |
_delay_ms(1000); // Wait for 1s | |
PORTC = 0b00000111; // Display Letter 7 | |
_delay_ms(1000); // Wait for 1s | |
PORTC =0b1111111; // Display Letter 8 | |
_delay_ms(1000); // Wait for 1s | |
PORTC = 0b01101111; // Display Letter 9 | |
_delay_ms(1000); // Wait for 1s | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment