The Grove Thumb Joystick is an analog device that connects to one analog port on the Grove shield but uses two analog pins on the Arduino to get X and Y components of the joystick’s movement.

Thumb Joystick

The X and Y axes are two ~10k potentiometers which control 2D movement by generating analog signals. The joystick also has a push button that could be used for special applications. It will output two analog values, representing two directions.

Hardware

The Thumb Joystick is an analog device that connects to one analog port on the Grove shield but uses two analog pins on the Arduino to get X and Y components of the joystick’s movement. On the Grove Beginner Kit, you NEED to connect it to A3 via a Grove Shield.

To work with the Grove Beginner Kit, you will need a Grove Sheild and connect the joystick to A3

Software

<<<<<<< HEAD <<<<<<< HEAD Functions that interact with the buzzer are prefixed with joystick.

>>>>>>> 8fd27ae…​ Updated joystick documentation

Retrieving and interpreting position information

>>>>>>> 8fd27ae…​ Updated joystick documentation

def joystick_get_x():
    """Get value in x-axis from Grove Joystick.
       returns x value normalized to [-1, 1]
def joystick_get_y():
    """Get value in y-axis from Grove Joystick.

       returns y value normalized to [-1, 1]
    """
def joystick_get_r_theta():
    """Get radius and angle from Grove Joystick.
       returns r (r = sqrt(x^2+y^2) and theta in radians (theta = atan(y/x))
    """