#include #include int main(void){ // pin 13 DDRB = 0x60; PORTB |= 0x20; // forward int i = 0; int sens = 0; while(1){ // step PORTB |= 0x40; _delay_ms(2); PORTB &= 0xBF; _delay_ms(2); // dir i++; if(i > 1000){ i = 0; sens = 1 - sens; if(sens == 0) PORTB |= 0x20; // forward else PORTB &= 0xDF; // backward } } return 0; }