const int DIR_1 = 5; const int STEP_1 = 6; const int STEP_REV = 200; int PULSE=1000; void setup() { pinMode(STEP_1, OUTPUT); pinMode(DIR_1, OUTPUT); digitalWrite(DIR_1, HIGH); Serial.begin(9600); // opens serial port, sets data rate to 9600 bps } void loop() { if (Serial.available() > 0) { PULSE = Serial.read(); // read the incoming byte: stepper1_on(); } } void stepper1_on(void) { digitalWrite(STEP_1, HIGH); delayMicroseconds(PULSE); digitalWrite(STEP_1, LOW); delayMicroseconds(PULSE); }