Код: Выделить всё
#include <avr/io.h>
#include <avr/delay.h>
int main(void)
{
DDRB = 0xff;
DDRD = 0x00;
while (1) {
if (PORTD == 0b00000001) {
PORTB = 0xff;
}
else {
PORTB = 0x00;
}
}
}