Manual

Table Of Contents
Arduino Kit Demo Description 9 JoyStick Demo
Issue V2.1 (2019-12-05) Demo Description Copyright © Yuejiang Technology Co., Ltd
31
else if(y < 400){ // JoyStick moves alongt Y-axis in the negative direction
direction = 2;
}
…...
……
Control the Dobot Magician and air pump by the joystick
Program 9.4 Control the Dobot Magician and air pump
switch(direction){
case 1:
Serial.println("forward");
Dobot_SetPTPCmdEx(MOVL_INC,20,0,0,0); //Dobot Magician moves forward
Serial.print("x=");
Serial.println(x);
Serial.print("y=");
Serial.println(y);
break;
case 2:
Serial.println("backwardss");
Dobot_SetPTPCmdEx(MOVL_INC,-20,0,0,0); // Dobot Magician moves backward
Serial.print("x=");
Serial.println(x);
Serial.print("y=");
Serial.println(y);
break;
……
……
}