If (Ps2X.newbuttonstate()) - Keyestudio 4DOF Manual

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

Advertisement

vibrate = ps2x.Analog(PSAB_BLUE);

if (ps2x.NewButtonState())

{
if(ps2x.Button(PSB_R3))
{
//Serial.println("R3 pressed");
// record
s1=myservo1.read();
delay(100);
Serial.println(s1);
s2=myservo2.read();
delay(100);
Serial.println(s2);
s3=myservo3.read();
delay(100);
Serial.println(s3);
s4=myservo4.read();
delay(100);
Serial.println(s4);
jiyi1[i]=s1; // save the servo value read in the array sequentially
jiyi2[i]=s2;
//this will set the large motor vibrate speed based on
//how hard you press the blue (X) button
//will be TRUE if any button changes state (on to off, or off to on)
240

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents