#include <Servo.h>
Servo smotor1;
Servo smotor2;
Servo smotor3;
Servo smotor4;
#define Button1 1
#define Button2 2
#define Button3 3
int angle = 90;
//int anglestep =5;
void setup() {
// put your setup code here, to run once:
pinMode(Button1,INPUT);
pinMode(Button2,INPUT_PULLUP);
pinMode(Button3,INPUT_PULLUP);
smotor1.attach(9);
smotor2.attach(8);
smotor3.attach(7);
smotor4.attach(6);
}
void loop() {
// put your main code here, to run repeatedly:
if( digitalRead(Button3) == HIGH) {
if(digitalRead(Button1) == HIGH){
angle+=1;
smotor1.write(angle);
}
if(digitalRead(Button2) == HIGH){
angle-=1;
smotor1.write(angle);
}
}
}