Hello All, been working on a small project with two mini servos.
The Joystick controls both servos, left and right. When in the neutral position, the x-axis servo trembles. That is to say it seems like it is getting input from the Joystick and it seems to tremble back and forth a little. This is undesirable as I want the laser to sit perfectly still. Below is a link so you can see and hear it in a video.
Also here is the code.
Any light anyone could shed would be greatly appreciated!
SoftwareServo myservo1; // object to control a servo
boolean light_on = false;
int reading = 0;
pinMode(3, OUTPUT); //pin 3 digital laser out (black to red BB)
pinMode(7, INPUT); // z COM port white to grey com port 7
if(light_on == true)
digitalWrite (3, HIGH); // turn the light on!
if(light_on == false) // turn the light off!
digitalWrite (3, LOW);
reading = digitalRead(7); // check the value of the z input on the joystick.
if (reading == 1)
light_on = ! light_on;
reading = 0;
x = analogRead(0);
x = map(x, 0, 1023, 0,180 );
y = analogRead(1);
y = map(y, 0, 1023, 0, 179);