Keyestudio 4DOF Manual page 183

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

Advertisement

www.keyestudio.com
On the drive shield there is a PS2 Joystick connector, which is easy for you
to control the 4DOF robot arm using the PS2 Joypad. But you need to
purchase it by yourself because the PS2 Joypad is not included in the kit.
When use the PS2 Joypad to control the robot arm, first need to get the
corresponding character of each key on the PS2 Joypad.
So this experiment will help you test the character of each key on the PS2
Joypad.
After connecting the Joypad, should upload the test program on Arduino
IDE. But before testing, should place the PS2X_lib folder inside the libraries
folder of Arduino IDE directory.
Uploading the code, open the serial monitor, connect the PS2 Joypad.
When press down the key, you should see the corresponding character on
the monitor.
Test Code 10:
#include <PS2X_lib.h> //for v1.6
PS2X ps2x; // create PS2 Controller Class
//right now, the library does NOT support hot pluggable controllers, meaning
//you must always either restart your Arduino after you conect the controller,
//or call config_gamepad(pins) again after connecting the controller.
180

Advertisement

Table of Contents
loading

Table of Contents