move servo with one push button
hi all i don't know do i move servo motor 1 push button in beginning move x degree after each push button pressed to 160°after servo come same prossecus each pb pressed servo come x° x° reach initial position 0° someone me, please ? thx helping #include <servo.h> // constant variables used set servo angles, in degrees const int straight = 0; const int divergent = 160; // constant variables holding ids of pins using const int buttonpin = 2; const int servopin = 9; // servo movement step delay, in milliseconds const int step_delay = 70; // create servo object servo myservo; // global variables store servo position int pos = straight; // current int old_pos = pos; // previous void setup() { // set mode digital pins in use pinmode(buttonpin, input); // setup servo myservo.attach(servopin); // attach servo on pin 9 myservo.write(pos); // set initial servo position...