#include <Servo.h>
Servo bes;
Servo on;
Servo ybes;
Servo elli;
Servo bir;// creating myservo object
#define buttonbes 11
#define buttonon 10
#define buttonybes 9
#define buttonelli 6
#define buttonbir 5
int bbes = 0;//set button pin
int bon = 0;//set button pin
int bybes = 0;//set button pin
int belli = 0;//set button pin
int bbir = 0;//set button pin
/*int buttonState = 0; // set buttonState
int eder = 0;
*/
void setup()
{
Serial.begin(115200);
bes.attach(12);// attach the 13 pin to servo
on.attach(8);
ybes.attach(7);
elli.attach(4);
bir.attach(2);
pinMode(buttonbes, INPUT); // set button to input
pinMode(buttonon, INPUT);
pinMode(buttonybes, INPUT);
pinMode(buttonelli, INPUT);
pinMode(buttonbir, INPUT);
/* pinMode(bes, INPUT);
pinMode(on, INPUT);
pinMode(ybes, INPUT);
pinMode(elli, INPUT);
pinMode(bir, INPUT);*/
}
void loop()
{
bbes = digitalRead(buttonbes);
bon = digitalRead(buttonon);
bybes = digitalRead(buttonybes);
belli = digitalRead(buttonelli);
bbir = digitalRead(buttonbir);
//eder = analogRead(buttonbes);
if(bbes == 1){
bes.write(75);
}
else if(bon == 1){
on.write(75);
}
else if(bybes == 1){
ybes.write(75);
}
else if(belli == 1){
elli.write(75);
}
else if(bbir == 1){
bir.write(75);
}
else{
bes.write(0);
on.write(0);
ybes.write(0);
elli.write(0);
bir.write(0);
}
delay(500);
}