EasyManua.ls Logo

Keyestudio 4DOF - Page 152

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...
149
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); // lower the speed overall
// claw
zhuazi();
// rotate
zhuandong();
// upper arm
xiaobi();
//lower arm
dabi();
}
//claw
void zhuazi()
{
//claw
if(x2<50) // if push the left joystick to the right
{
pos4=pos4-2; //current angle of servo 4 subtracts 2(change the value you subtract, thus change the closed speed of claw)
//Serial.println(pos4);
myservo4.write(pos4); // servo 4 operates the action, claw is gradually closed.
delay(5);

Related product manuals