Keyestudio 4DOF Manual page 223

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

Advertisement

www.keyestudio.com
// turn
void zhuandong()
{
//turn right
if(ps2x.Analog (PSS_RX) > 200) // if push the right joystick to the right
{
//Serial.println(ps2x.Analog(PSS_RX), DEC);
pos1=pos1-1;
myservo1.write(pos1);
right
// delay(5);
if(pos1<1)
{
pos1=1;
}
}
//左转
if(ps2x.Analog (PSS_RX) < 50)
{
//Serial.println(ps2x.Analog(PSS_RX), DEC);
pos1=pos1+1;
myservo1.write(pos1);
//pos1 subtracts 1
// servo 1 carries out the action and the arm will turn
// limit the right turning angle
//pos1 plus 1
// the arm will turn left
//if push the right joystick to the left
220

Advertisement

Table of Contents
loading

Table of Contents