#include <Servo.h>
Servo myServo;
int servo_Pin=9;
int potpin= A0;
int val ;
void setup() {
// put your setup code here, to run once:
myServo.attach(9);
pinMode (8, OUTPUT);
pinMode (7, OUTPUT);
pinMode (potpin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
val= analogRead (potpin=A0);
val= map (val , A0, 1023, 0, 179);
myServo. write(val);
if (val, >89) {
digitalWrite(8, HIGH);
}
if(val, >178) {
digitalWrite(7, HIGH);
}
else {
digitalWrite (8, LOW);
digitalWrite (7, LOW);
}
}