hello guys i need your help
There are 4 LEDs in a system and one servo.
The servo has 4 positions, these are 0 60 120 180 degrees. I wait for 5 seconds in every movement of the servo and the leds are on to tell what degree it is, example 1.led indicates 0 degrees, 2. led 60 degrees. I am running the servo motor, but I cannot add the leds, can you help? Thank you from now.
#include <Servo.h>
Our servo motor;
// we defined a servo motor named our motor
int led1 = 2; // We assigned the led pins
int led2 = 3;
int led3 = 4;
int led4 = 5;
void setup() {
our engine.attach(A0);
}
void loop()
{
our engine.write(0); // get to 0 degrees
delay(5000); // wait 5 seconds
our engine.write(60);// come to 60 degrees
delay(5000);// wait 5 seconds
our engine.write(120);// come to 120 degrees
delay(5000);// wait 5 seconds
our engine.write(180);// come to 180 degrees
}