int inPin = 52; int outPin = 22; int val = 0; int pulse = 4500; void setup() { // put your setup code here, to run once: pinMode(inPin, INPUT); pinMode(outPin, OUTPUT); } void loop() { // put your main code here, to run repeatedly: val = digitalRead(inPin); if(val == HIGH) { digitalWrite(outPin, HIGH); delayMicroseconds(pulse); digitalWrite(outPin,LOW); Serial.println("Recieved high, spin"); } else { digitalWrite(outPin,LOW); Serial.println("Recieved low, still"); } delay(20); }