Two-axis key joystick sensor module by the use of for PS2 rocker potentiometer, with (X, Y) 2-axis analog output, (Z) 1 button digital output.
With the sensor expansion board can produce remote control and other interactive works.
In addition, this product in order to allow customers to more easily with the a-rd-ui-no expansion board and other standard interfaces, in the design of the X, Y, Z axis of the circuit are separate leads, the user can use 3-pin a-rd-ui-no special line really plug into the expansion board .
Tutorial:
In fact, this module is a potentiometer, x, y-dimensional data output port is read out the analog voltage.
This figure does not draw the above z-dimensional data output, z-dimensional output only 0 and 1, can be achieved by a button.
All in all, it is a combination of potentiometer and button. In the a-rd-ui-no use it, x, y dimension we received two analog ports to read their values, while the z-dimensional we are connected to the digital port, connected to the power and ground.
Test Program:
Int JoyStick_X = 0; // x
Int JoyStick_Y = 1; // y
Int JoyStick_Z = 3; // key
Void setup () {pinMode (JoyStick_X, INPUT);
PinMode (JoyStick_Y, INPUT);
PinMode (JoyStick_Z, INPUT);
Serial.begin (9600); // 9600 bps}
Y = analogRead (JoyStick_Y); z = digitalRead (JoyStick_Z); void loop () {int x, y, z;
Serial.print (x, DEC); Serial.print ( ",");
Serial.print (y, DEC); Serial.print ( ",");
Serial.println (z, DEC);
Package include:
4 x joystick breakout module