Here's my code that I used. I might explain it later, I'm kind of lazy. Thats what
this and
this are for.
#include <Servo.h>
Servo myservo;
int button7=0;
int button6=0;
int pos=90;
void setup()
{
pinMode(7, INPUT);
pinMode(6, INPUT);
myservo.attach(9);
}
void loop()
{
button7=digitalRead(7);
button6=digitalRead(6);
myservo.write(pos);
delay(5);
pos=constrain(pos,0,180);
if(button7==1 && button6==0)
{
pos++;
}
if(button7==0 && button6==1)
{
pos--;
}
}
Any bugs, glitches? I don't notice any...