In this one, servo is programmed to be controlled by two buttons, one turns servo to the left and the other one turns it to the right. When the servo is turning, corresponding LED will be switched on to indicate the operation.
|// Oscar’s Project
// There are 2 input buttons (turn left and right), when button is pressed, the servo turns and corresponding LED is lit up.
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created