Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define stepX 13
- #define dirX 12
- int nVoltas = 10;
- int tempo = 1000;
- // -------------------------------------------
- void setup()
- {
- pinMode(stepX, OUTPUT); // Step
- pinMode(dirX, OUTPUT); // Dir
- }
- // -------------------------------------------
- void loop()
- {
- for (unsigned long x = 0; x < nVoltas * 200; x++)
- {
- digitalWrite(stepX, HIGH); // Output high
- delayMicroseconds(tempo); // Wait
- digitalWrite(stepX, LOW); // Output low
- delayMicroseconds(tempo); // Wait
- Serial.println(x);
- }
- delay(2000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement