#include Servo servo; int butt = 0; int butt2 = 0; float rot; int Button2 = 3; int Button = 4; int yes; int yes2; int yes3; int yes4; void setup() { rot = 90; servo.attach(8); servo.write(0); Serial.begin(9600); pinMode(Button, INPUT); pinMode(Button2, INPUT); } void loop() { Serial.println(rot, 5); //=============================================================== if (Serial.available() > 0) { char yes = Serial.read(); if (yes == '1') { rot -= 1; } else { { rot += 1; } } } //============================================================================ butt = digitalRead(Button); if (butt != 0) { if (rot < 180) { rot += 1; } } //======================================================== butt2 = digitalRead(Button2); if (butt2 != 0) { if (rot > 0) { rot -= 1; } } servo.write(rot); }