Mech-Dickel wanted to use the joystick of a game pad to control the direction and use a button key to start and stop. In this example we are going to control the Y axis of a pan / tilt kit, and use the (1) button for on / off.
I am using a wireless Logitech rumble pad 2, a BBB Arduino, and a generic servo.
I have loaded the latest MRLComm.ino into the Arduino and will be using the following MyRobotLab Services:
Rather than MRL (MyRobotLab) sending individual incremental position commands to the servo on where to go, we will tell the servo to move at an incremental speed. When the servo is moving at an incremental speed (<1.0) we have the ability to tell the servo to stop. If we had sent a command to the servo from Python for each position the 57600bps serial speed and the computer's scheduler can make the movement very jittery. Telling the Arduino to start moving and when its moved to the correct position, commanding it to stop is much more effecient and smooth.