Keyestudio 4DOF Manual page 212

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

Advertisement

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
if(Serial.available())
// if receive the data
{
val=Serial.read();
// read the received data
Serial.println(val);
switch(val)
{
case 'B': T_left(); break;
case 'C': T_right(); break;
case 'A': RF(); break;
case 'D': RB(); break;
case '2': ZK(); break;
case '3': ZB(); break;
case '1': LF(); break;
case '4': LB(); break;
}
}
}
//**************************************************
// turn left
void T_left()
// execute the corresponding function when receive the value
209

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents