Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define Dir1 7
- #define Pul1 5
- #define Dir2 11
- #define Pul2 8
- int Tempo = 400;
- void setup()
- {
- pinMode(Dir1, OUTPUT);
- pinMode(Pul1, OUTPUT);
- pinMode(Dir2, OUTPUT);
- pinMode(Pul2, OUTPUT);
- digitalWrite(Dir1, HIGH);
- digitalWrite(Dir2, HIGH);
- Serial.begin(9600);
- }
- void loop()
- {
- digitalWrite(Dir1, HIGH);
- for (int i = 0; i < 10000; i++)
- {
- digitalWrite(Pul1, HIGH);
- delayMicroseconds(Tempo);
- digitalWrite(Pul1, LOW);
- delayMicroseconds(Tempo);
- }
- digitalWrite(Dir1, LOW);
- for (int i = 0; i < 10000; i++)
- {
- digitalWrite(Pul1, HIGH);
- delayMicroseconds(Tempo);
- digitalWrite(Pul1, LOW);
- delayMicroseconds(Tempo);
- }
- digitalWrite(Dir2, HIGH);
- for (int i = 0; i < 10000; i++)
- {
- digitalWrite(Pul2, HIGH);
- delayMicroseconds(Tempo);
- digitalWrite(Pul2, LOW);
- delayMicroseconds(Tempo);
- }
- digitalWrite(Dir2, LOW);
- for (int i = 0; i < 10000; i++)
- {
- digitalWrite(Pul2, HIGH);
- delayMicroseconds(Tempo);
- digitalWrite(Pul2, LOW);
- delayMicroseconds(Tempo);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement