#define DIR 19
#define STEP 20
#define PUSH 28
void setup() {
// put your setup code here, to run once:
pinMode(DIR, OUTPUT);
pinMode(STEP, OUTPUT);
pinMode(PUSH, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(DIR, LOW);
if(digitalRead(PUSH) == 0)
digitalWrite(STEP, HIGH);
else
digitalWrite(STEP, LOW);
delay(1); // this speeds up the simulation
}