Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 0 movement
- #include <mega32.h>
- #include<delay.h>
- void main(void)
- {
- // Declare your local variables here
- // Port A initialization
- DDRA=0xFF; // Selector
- // Port B initialization
- DDRB=0xFF; // Data
- while (1)
- {
- // Place your code here
- PORTA=0b11111110; // number ‘4’ 7-segment is ON
- PORTB=0b01100110; // digit ‘8’
- delay_ms(50);
- PORTA=0b11111101; // number ‘4’ 7-segment is ON
- PORTB=0b01100110; // digit ‘8’
- delay_ms(50);
- PORTA=0b11111011; // number ‘4’ 7-segment is ON
- PORTB=0b01100110; // digit ‘8’
- delay_ms(50);
- PORTA=0b11110111; // number ‘4’ 7-segment is ON
- PORTB=0b01100110; // digit ‘8’
- delay_ms(50);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement