Dual-axis joystick module is using PS2 joystick potentiometer, with (X,Y) 2-axis analog output, (Z) 1-channel button digital output. With ARDUINO sensor expansion board can produce remote control and other interactive works. In the design of the XY, Z-axis circuits are individually pinned out, use a 3-pin cable to the board.
Features
- Input voltage: DC 3.3V to 5V
- Output signal:
- 2 analog outputs - (X, Y) dual-axis offset (analog signal)
- 1 digital output - whether Z-axis is pressed or not (digital signal).
- Compatible with ARDUINO controller
- Bi-directional 10K resistor, Joystick in different directions changes the resistance value.
- 5VDC power supply.
- (X, Y) value about 2.5V @static state
- Move the Joystick changes the voltage value, form 0V to 5V
Pinout
- 5V: 5V
- GND: GND
- URX: Analog 0
- URY: Analog 1
- SW: Digital 2
Lieferumfang:
- 1x Joystick Breakout Module
Demo Code
#define PIN_X 0
#define PIN_Y 1
#define PIN_Z 2
void setup() {
pinMode(PIN_X, INPUT);
pinMode(PIN_Y, INPUT);
pinMode(PIN Z, INPUT);
Serial.begin(9600);
}
void loop() {
int x,y,z;
x=analogRead(PIN_X);
y=analogRead(PIN_Y);
z=analogRead(PIN_Z);
Serial.print("X=");
Serial.print(x);
Serial.print("\tY=");
Serial.print(y);
Serial.print("\tZ=");
Serial.println(z);
delay(1000);
}
Shenzhen Harztec Technology Co., 309, 3F, Block B, Ganfeng Technology Building 1, No.993 Jiaxian Road, Xiangjiaotang Community, Bantian Street,, 518129 Shenzhen, China, [email protected], https://harztec.com