#include <Servo.h>
Servo myservo1;
int pos = 0;
int tombol1 = 7;
int tombol2 = 6;
int posisiservo = 0;
void setup (){
myservo1.attach(5);
pinMode(tombol1, INPUT_PULLUP);
pinMode(tombol2, INPUT_PULLUP);
myservo1.write(posisiservo);
}
void loop(){
if(!digitalRead(tombol1))
{
myservo1.write(posisiservo);
posisiservo -=1;
delay(5);
}
if(!digitalRead(tombol2))
{
myservo1.write(posisiservo);
posisiservo +=1;
delay((5));
}
}