Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/io.h>
- #define F_CPU 14.7456E6
- #include <util/delay.h>
- int main(void)
- {
- DDRB = 0xFF;
- PORTB = 0x00;
- DDRD = 0x00;
- PORTD = 0xFF;
- while(1)
- {
- if ((~PIND & (1<<PD0)))
- {
- PORTB = 0xFF;
- }
- else if ((~PIND & (1<<PD1)))
- {
- PORTB = 0x00;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement