Keyestudio 4DOF Manual page 174

Robot mechanical arm kit for arduino diy
Hide thumbs Also See for 4DOF:
Table of Contents

Advertisement

myservo4.attach(9);
// set the control pin of servo 4 to D9
x1 = analogRead(right_X); // read the right X value
y1 = analogRead(right_Y); // read the right Y value
z1 = digitalRead(right_key); // read the right Z value
x2 = analogRead(left_X); // read the left X value
y2 = analogRead(left_Y); // read the left Y value
z2 = digitalRead(left_key); // read the left Z value
//delay(5); // reduce the speed overall
if(z1==1)
// if the right joystick key is pressed
{
delay(10);
// delay for eliminating shake
if(z1==1)
// judge again if the right key is pressed
{
s1=myservo1.read();
// read the angle value of each servo
delay(100);
Serial.println(s1);
s2=myservo2.read();
delay(100);
Serial.println(s2);
s3=myservo3.read();
delay(100);
Serial.println(s3);
s4=myservo4.read();
delay(100);
171

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 4DOF and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF