Feel the Difference with Servo’s Joystick Control

Have you ever inspired by any walking servo or pixel rocket before? Did you have the urge to build a similar or even better prototype for yourself?

Since the servo is the easiest to be controlled, you should try to manipulate it into your joystick control. Yeah, your task for today is to create a simple joystick control with a servo over a USB connection.

Let’s start with the hardware part first, and what you need to do is:

  1. You need to make sure that the JR Sport ST47 standard servo is wired directly to Arduino’s 5V power and ground.
  2. Also, connect the servo’s control wire to Digital pin #2.
  3. The Arduino and the standard USB joystick need to be connected to a PC with a USB cable as well.

The software part includes a Python script (Interpreting inputs from the joystick) and the Arduino sketch. A common joystick normally has six different axes. The Python’s responsibility is to sense inputs from each axis, and then print the values of stick positions.

The joystick axis will reports a range of decimal values in between -1.0 and 1.0, with the zero means for center position. After it, the script converts the values into numbers between zero and 180 degree. This is the real value for the servo position.

[..Source link..]

Bookmark the permalink.

Comments are closed.