Keyestudio 4DOF Manual page 233

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

Advertisement

www.keyestudio.com
myservo2.attach(A0); //set the control pin of servo 2 to A0
myservo3.attach(6);
myservo4.attach(9);
if(error != 0)
return;
ps2x.read_gamepad(false, vibrate);
'vibrate' speed
if(ps2x.Button(PSB_START))
Serial.println("Start is being held");
if(ps2x.Button(PSB_SELECT))
Serial.println("Select is being held");
if(ps2x.Button(PSB_PAD_UP)) {
Serial.print("Up held this hard: ");
Serial.println(ps2x.Analog(PSAB_PAD_UP), DEC);
}
if(ps2x.Button(PSB_PAD_RIGHT)){
Serial.print("Right held this hard: ");
//set the control pin of servo 3 to D6
//set the control pin of servo 4 to D9
//will be TRUE as long as button is pressed
//read controller and set large motor to spin at
//will be TRUE as long as button is pressed
230

Advertisement

Table of Contents
loading

Table of Contents