Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/io.h>
- #include <avr/delay.h>
- #define F_CPU 1000000UL
- int main(void)
- {
- PORTA = 0b00000000;
- DDRA = 0xFF;
- // for(int i = 8; i >= 0 ; i--)
- // {
- // PORTA += (1 << i);
- // _delay_ms(1000);
- // }
- //
- // for(int i = 0; i <= 8 ; i++)
- // {
- // PORTA -= (1 << i);
- // _delay_ms(1000);
- // }
- // for(int i = 3 ; i >= 0 ; i--)
- // {
- // PORTA += (1 << i);
- // _delay_ms(1000);
- // }
- // for(int i = 0 ; i <= 3 ; i++)
- // {
- // PORTA -= (1 << i);
- // _delay_ms(1000);
- // }
- //
- // for(int i = 4 ; i <= 8 ; i++)
- // {
- // PORTA += (1 << i);
- // _delay_ms(1000);
- // }
- //
- // for(int i = 8 ; i >= 4 ; i--)
- // {
- // PORTA -= (1 << i);
- // _delay_ms(1000);
- // }
- for(int i = 8 ; i >= 4 ; i--)
- {
- PORTA += (1 << i);
- _delay_ms(1000);
- }
- for(int i = 4 ; i <= 8 ; i++)
- {
- PORTA -= (1 << i);
- _delay_ms(1000);
- }
- for(int i = 0 ; i <= 3 ; i++)
- {
- PORTA += (1 << i);
- _delay_ms(1000);
- }
- for(int i = 3 ; i >= 0 ; i--)
- {
- PORTA -= (1 << i);
- _delay_ms(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement