AT line 94 in the code i want to make a flasher to the led during the motor is running at opening condition , please can i get a help ?!
limiitswitchtest22.ino (5.95 KB)
AT line 94 in the code i want to make a flasher to the led during the motor is running at opening condition , please can i get a help ?!
limiitswitchtest22.ino (5.95 KB)
This loop is executing while your motor is running:
while (digitalRead(limswitch) == LOW); // Wait for limit switch to trigger (may need HIGH instead of LOW)
You can put the "BlinkWithoutDelay" blink code in the loop:
while (digitalRead(limswitch) == LOW) { // Wait for limit switch to trigger (may need HIGH instead of LOW)
// From the BlinkWithoutDelay example
unsigned long currentMillis = millis();
if(currentMillis - previousMillis >= interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
ledState = !ledState;
digitalWrite(ledPin, ledState);
}
}