Hi i am new to this stuff so it might be obvious or dump, but why doesn't this work?
#include <Servo.h>
Servo servox;
Servo servoy;
int xp=11;
int xm=10;
int yp=9;
int ym=8;
int f=7;
int posx=0;
int posy=0;
void setup()
{
servox.attach(13);
servoy.attach(12);
pinMode (xp,INPUT);
pinMode (xm,INPUT);
pinMode (yp,INPUT);
pinMode (ym,INPUT);
}
void loop()
{
servox.write(posx);
if(digitalRead(xp),HIGH);
{
posx=posx+1;
}
if(digitalRead(xm),HIGH);
{
posx=posx-1;
}
if(digitalRead(yp),HIGH);
{
posy=posy+1;
}
if(digitalRead(ym),HIGH);
{
posy=posy-1;
}
}
please help if you can