Keyestudio 4DOF Manual page 189

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

Advertisement

int jiyi4[20];
int i=0; // for loop
int j=0; // save the last value of i
void setup()
{
// boot posture
myservo1.write(pos1); //turn servo 1 to 90 degrees
delay(1000);
myservo2.write(pos2); // turn servo 2 to 90 degrees
myservo3.write(pos3); // turn servo 3 to 120 degrees
myservo4.write(pos4); // turn servo 4 to 35 degrees
delay(1500);
pinMode(right_key, INPUT);
pinMode(left_key, INPUT);
Serial.begin(9600);
// set the baud rate to 9600
}
void loop()
{
myservo1.attach(A1); // set the control pin of servo 1 to A1
myservo2.attach(A0); // set the control pin of servo 2 to A0
myservo3.attach(6);
//set the control pin of servo 3 to D6
myservo4.attach(9);
// set the control pin of servo 4 to D9
// set the right/left key to INOUT
186

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents