24 lines
352 B
C
24 lines
352 B
C
#define F_CPU 16000000UL
|
|
#include <avr/io.h>
|
|
#include <util/delay.h>
|
|
|
|
|
|
int main(void)
|
|
{
|
|
DDRB = 0xff;
|
|
DDRD = 0;
|
|
|
|
PORTD |= (1 << PORTD2) | (1 << PORTD3);
|
|
|
|
PORTB = 0;
|
|
|
|
while (1)
|
|
{
|
|
if (! (PIND & (1 << PIND2))) {
|
|
PORTB |= (1 << PORTB5);
|
|
}
|
|
if (! (PIND & (1 << PIND3))) {
|
|
PORTB &= ~(1 << PORTB5);
|
|
}
|
|
}
|
|
}
|