'blinking led while servo is turning arduino
I have a code here that turn servo motor back and forth and i want to add blinking led while servo motor is turning.
How do i apply it?
here's the code
#include <Servo.h>
Servo servo;
void setup()
{
pinMode(4, OUTPUT);
servo.attach(9);
}
void loop()
{
servo.write(180);
delay(2000);
blink();
servo.write(0);
delay(2000);
blink();
}
void blink() {
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
