Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 7 SEGMENT.c
- *
- * Created: 23.9.2019 11:41:50
- * Author : PC
- */
- #define AVR_ATmega16 1
- #define F_CPU 8000000UL
- #include <avr/io.h>
- #include <util/delay.h>
- int main(void)
- {
- /* Replace with your application code */
- unsigned char tab[5]=
- {
- 0b11111111, //index 0
- 0b01111110, //index 1
- 0b00111100, //index 2
- 0b00011000, //index 3
- 0b00000000, //index 4
- DDRC=0b11111111;
- PORTC=0b11111111;
- while (1)
- {
- unsigned char index;
- for (index=0; index<=4; index++);
- {
- PORTC=tab[index]; //výběr kombinace a odeslání
- _delay_ms(500); //prodleva
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement