Servo myservo ;
int button7 = 0 ;
int button6 = 0 ;
int pos = 90 ;
void setup()
{
pinMode (7, entrée) ;
pinMode (6, entrée) ;
myservo.Attach(9) ;
}
void loop()
{
Button7=digitalRead(7) ;
Button6=digitalRead(6) ;
myservo.Write(POS) ;
Delay(5) ;
POS=Constrain(POS,0,180) ;
Si (button7 == 1 & & button6 == 0)
{
PDS ++ ;
}
Si (button7 == 0 & & button6 == 1)
{
POS--;
}
}