EasyManua.ls Logo

Keyestudio 4DOF - Page 212

Keyestudio 4DOF
276 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
209
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; // execute the corresponding function when receive the value
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()

Related product manuals