Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef F_CPU
- #define F_CPU 1000000UL
- #endif
- #include <avr/io.h>
- #include <util/delay.h>
- int main(void)
- {
- DDRA |= 0xFF;
- DDRB &= 0xFE;
- PORTB = 0x01;
- while(1)
- {
- while ((PINB & (1<<PB0)))
- {
- PORTA = 0x00;
- }
- while (!(PINB & (1<<PB0)))
- {
- PORTA ^= 0x01;
- _delay_ms(30);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement