But the servo wont stop move on it's own even when there is no signal from ps2 controller..I think it's some kind of noise
I would like to know if there is a way to solve this problem..This is the sketch
- CODE: SELECT_ALL_CODE
#include <Servo.h>
#include <Shield_PS2.h>
PS2 ps2=PS2();
Servo myservo;
void setup()
{
myservo.attach(9);
ps2.init(9600, 2, 3);
}
void loop()
{
if( ps2.getval(p_left)==0)
{
myservo.writeMicroseconds (1100);
delay (10);
}
if( ps2.getval(p_up)==0)
{
myservo.writeMicroseconds (1600);
delay (10);
}
if( ps2.getval(p_right)==0)
{
myservo.writeMicroseconds (2300);
delay (10);
}
}