Skip to content

Instantly share code, notes, and snippets.

@giljr
Created November 15, 2018 14:42
Show Gist options
  • Save giljr/4d52810d469acd5711a32b036c84fbee to your computer and use it in GitHub Desktop.
Save giljr/4d52810d469acd5711a32b036c84fbee to your computer and use it in GitHub Desktop.
// Full Step
#define stepper PORTB
#define waiting_time 500
void setup() {
for (int z = 8; z < 12; z++) { // FULL STEP DRIVE
pinMode(z, OUTPUT); // pins 8,9,10,11 output for driving the motor
}
}
void loop() {
stepper = 0B0011; // 0x03;
delay(waiting_time);
stepper = 0B0110; // 0x06;
delay(waiting_time);
stepper = 0B1100; // 0x0C;
delay(waiting_time);
stepper = 0B1001; // 0x09;
delay(waiting_time);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment