JOYSTICK

TINKS012

  1. The Joystick module is similar to analog joysticks found in gamepads.
  2. It is made by mounting two potentiometers at a 90 degrees angle.
  3. The potentiometers are connected to a short stick centred by springs.
  4. Module provides an analog output.
Features:-
  1. Two independent Potentiometer: one for each axis ( X and Y)
  2. Auto return to center position
  3. Low weight
  4. Cup-type Knob
  5. 5V DC operating voltage.
  6. I/O pins are 5V and 3.3V compliant.
  7. Compatible to interface with Arduino or with most microcontrollers.
  8. Output:- analog
Applications:-
  1. Camera Pan/Tilt Control
  2. Game Input/Control
  3. Robot Control
  4. Analog Input of Parameters
  5. Widely use in DIY projects

    

int SW_pin = 2; // digital pin connected to switch output

int X_pin = A0; // analog pin connected to X output

int Y_pin = A1; // analog pin connected to Y output

 

void setup() {

pinMode(SW_pin, INPUT);

digitalWrite(SW_pin, HIGH);

Serial.begin(9600);

}

 

void loop() {

Serial.print("X-axis: ");

Serial.print(analogRead(X_pin));

Serial.print("\n");

Serial.print("Y-axis: ");

Serial.println(analogRead(Y_pin));

Serial.print("\n\n");

delay(1000);

}