Skip to product information
1 of 6

Lonten Tech

Custom Original Dual Axis Key Rocker PS2 Game Rocker Lever Sensor JoyStick Electronic Building Block HOT

Custom Original Dual Axis Key Rocker PS2 Game Rocker Lever Sensor JoyStick Electronic Building Block HOT

Regular price $0.74 USD
Regular price $3.74 USD Sale price $0.74 USD
Sale Sold out

Product description
The company produced PS2 game two-axis joysker sensor module by the use of original quality
Metal PS2 rocker potentiometer, with (X,Y) 2-axis analog output, (Z) 1-way button
Digital output. With the Arduino sensor expansion board, you can make remote control and other interactive activities
Product. In addition, this product makes it more convenient for customers to cooperate with arduino expansion board and other standards
Quasi-interface, in the design of X,Y,Z axis of the circuit are led out separately, the user can use 3
The special ARDUINO cable of the pin is really plugged into the expansion board. For use on. It's very convenient.
Product characteristics
It is like a joystick in the game console, you can control the input of this operation
The values of x, y, z of the longitudinal bar module and the implementation of a certain function under a specific value, it can
To be seen as a combination of button and potentiometer. The x and y dimensions of the data type are analog inputs
The incoming signal and the Z-dimension are digital input signals, so the x and y ports are connected to the analog pins
The sensor end, while the z port is connected to the digital port.
Instructions for use
Before introducing how to use it, let's take a look at how it works, so that We also know what's going on inside it, which helps us use it,
Here is a functional diagram, let's take a look

 

Now we should be clear at a glance, in fact, it is a potentiometer, x, y dimension data output is the analog port read voltage value, is not a little unexpected. Of course it doesn't draw the z-dimensional output, but it's simpler, we know z
Dimension only outputs 0 and 1, so it can be achieved with a press of a button. Now should we say a word above, it is a combination of potentiometer and button.
After reading the figure above, I believe that everyone knows how to use it under Arduino, x and y dimension we receive two analog ports to read their values, and Z dimension we receive digital ports, so it is done, and add power and ground, so it is good...

Arduino controller X 1
USB cable X1
Game sensor module X 1
Here x I am connected to analog port 0, y is connected to analog port 1, z I am connected to digital port 7, the relevant port number can see the personal situation, but the attribute can not be wrong. The code is as follows:
int sensorPin= 5;
int value = 0;
void setup() {
pinMode(7, OUTPUT);
Serial.begin(9600);
void loop() {
value = analogRead(0);
Serial.print("X:");
Serial.print(value, DEC);
value = analogRead(1);
Serial.print(" | Y:");
Serial.print(value, DEC);
value = digitalRead(7);
Serial.print("| Z: ");  .
Serial.println(value, DEC);
delay(100);

Program function description: It can put the state of the game sensor (x,y,z 3D data) real-time reaction to the computer display.

View full details