#include #include // quick and dirty: the stepping sequence as 8 constant values uint8_t steps[8]={0b0001,0b0011,0b0010,0b0110,0b0100,0b1100,0b1000,0b1001}; int main(void) { uint8_t i=0; DDRD = 0x0F; // motor driver connected to PD0-PD3 while (1) { PORTD = steps[i]; i++; i %= 8; _delay_ms(1); // delay between steps } }