Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * lab3.c
- *
- * Created: 26.04.2022 15:35:03
- * Author : Student_PL
- */
- #ifndef F_CPU
- #define F_CPU 1000000UL
- #endif
- #include <avr/io.h>
- #include <util/delay.h>
- char array[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
- char tablica[] = {0b10000110, 0b10100011};
- int main(void)
- {
- DDRA = 0b11111111;
- DDRB = 0b11111111;
- while (1)
- {
- PORTA = tablica[0];
- PORTB = 0b00001011;
- _delay_ms(1000);
- PORTA = tablica[1];
- PORTB = 0b00001110;
- _delay_ms(1000);
- /*for(int i=0;i<10;i++)
- {
- PORTA = array[i];
- _delay_ms(50);
- }*/
- }
- }
- /*
- * lab3.c
- *
- * Created: 26.04.2022 15:35:03
- * Author : Student_PL
- */
- #ifndef F_CPU
- #define F_CPU 1000000UL
- #endif
- #include <avr/io.h>
- #include <util/delay.h>
- char array[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
- char tablica[] = {0b10000110, 0b10100011};
- char tablica_liczba[] = {0xF9, 0x92, 0xF9, 0x82};
- int main(void)
- {
- DDRA = 0b11111111;
- DDRB = 0b11111111;
- while (1)
- {
- PORTA = tablica_liczba[0];
- PORTB = 0b00000111;
- _delay_ms(1);
- PORTA = tablica_liczba[1];
- PORTB = 0b00001011;
- _delay_ms(1);
- PORTA = tablica_liczba[0];
- PORTB = 0b00001101;
- _delay_ms(1);
- PORTA = tablica_liczba[3];
- PORTB = 0b00001110;
- _delay_ms(1);
- /*for(int i=0;i<10;i++)
- {
- PORTA = array[i];
- _delay_ms(50);
- }*/
- }
- }
Add Comment
Please, Sign In to add comment