void setup() {
Serial.begin(115200);
pinMode(8, OUTPUT); // !Enable
pinMode(2, OUTPUT); // A-step
pinMode(5, OUTPUT); // A-dir
pinMode(3, OUTPUT); // B-step
pinMode(6, OUTPUT); // B-dir
pinMode(4, OUTPUT); // C-step
pinMode(7, OUTPUT); // C-dir
pinMode(12, OUTPUT); // D-STEP
pinMode(13, OUTPUT); // D-DIR
// PIND is the input register of port D (pins 0 to 7 on the UNO)
PIND = 0b10100000; // Reverse direction AB
}
void loop() {
PIND = 0b11100;
// PINB is the input register of port D (pins 8 to 13 on the UNO)
PINB = bit(4);
delay(100);
delayMicroseconds(35);
}