Keyestudio 4DOF Manual page 224

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

Advertisement

}
if(ps2x.Button(PSB_PAD_DOWN)){
Serial.print("DOWN held this hard: ");
Serial.println(ps2x.Analog(PSAB_PAD_DOWN), DEC);
}
vibrate = ps2x.Analog(PSAB_CROSS); //this will set the large motor vibrate speed based on how hard you press the blue (X) button
if (ps2x.NewButtonState()) {
if(ps2x.Button(PSB_L3))
Serial.println("L3 pressed");
if(ps2x.Button(PSB_R3))
Serial.println("R3 pressed");
if(ps2x.Button(PSB_L2))
Serial.println("L2 pressed");
if(ps2x.Button(PSB_R2))
Serial.println("R2 pressed");
if(ps2x.Button(PSB_TRIANGLE))
Serial.println("Triangle pressed");
}
if(ps2x.ButtonPressed(PSB_CIRCLE))
Serial.println("Circle just pressed");
if(ps2x.NewButtonState(PSB_CROSS))
Serial.println("X just changed");
if(ps2x.ButtonReleased(PSB_SQUARE))
Serial.println("Square just released");
//will be TRUE if any button changes state (on to off, or off to on)
//will be TRUE if button was JUST pressed
//will be TRUE if button was JUST pressed OR released
//will be TRUE if button was JUST released
221

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents