Skip to content

Instantly share code, notes, and snippets.

@SimoDax
Created January 10, 2018 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimoDax/fdf0b3b72566efea0cdbdd089a5d65ed to your computer and use it in GitHub Desktop.
Save SimoDax/fdf0b3b72566efea0cdbdd089a5d65ed to your computer and use it in GitHub Desktop.
void spin()
{
for(t = 0; t < 600000 / (DELAY * 8); t++) //25000 = 10 min / (DELAY * 8) = number of cycles
for(i = 0; i < 8; i++){ //single full-step cycle
PORTB = lookup[i]; //here's where the magic happens :)
delay(DELAY);
}
PORTB = 0;
for(t = 0; t < 600000 / (DELAY * 8); t++) //25000 = 10 min / (DELAY * 8) = number of cycles
for(i = 0; i < 8; i++){ //single full-step cycle
PORTB = lookup[7-i]; //here's where the reverse magic happens :)
delay(DELAY);
}
PORTB = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment