Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define Step 9 // Clk+
- #define Dir 8 // Cw+
- #define leitura 3 // botao
- unsigned int Qtde_Steps = 50;
- unsigned int velocity = 100;
- //--------------------------------------------
- void setup()
- {
- Serial.begin(9600);
- pinMode(leitura, INPUT_PULLUP);
- pinMode(Dir, OUTPUT);
- pinMode(Step, OUTPUT);
- digitalWrite(Dir, LOW);
- digitalWrite(Step, LOW);
- digitalWrite(Dir, HIGH);
- }
- //---------------------------------------------
- void loop()
- {
- // if (leitura == LOW)
- // {
- for ( int i = 0; i < 50 ; i++)
- {
- digitalWrite(Step, HIGH);
- delayMicroseconds(100);
- digitalWrite(Step, LOW);
- delayMicroseconds(100);
- }
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement