#include<Servo.h>
int button = 7;
int button1 = 3;
int SERVO_PIN = 9;
Servo servo;
int pos = 0;
void setup()
{
Serial.begin(9600);
servo.attach(SERVO_PIN);
pinMode(button, INPUT_PULLUP);
pinMode(button1, INPUT_PULLUP);
}
void loop()
{
if (digitalRead(button) == LOW)
{
pos++;
delay(5);
servo.write(pos);
Serial.println(pos);
}
if (digitalRead(button1) == LOW)
{
pos--;
delay(5);
servo.write(pos);
Serial.println(pos);
}
}