Description
Features:
Color: Black
KY-023 dual axis joystick breakout module.
Equipped with bidirectional 10K resistor, the tap will vary with the joystick direction change.
5V working voltage and original state of X, Y readout voltage is about 2.5V, when press down in the arrow direction,the voltage will increases up to 5V,press the arrow in the opposite direction, voltage decreases, the minimum is 0V.
Suitable for Arduino UNO,for Arduino UNO R3, Arduino 2560 development board to design the creative control interactive works.
Size:
34*26*32mm KY-023 Joystick Breakout Module Game Controller For Arduino Hots
Package Included:
1 x Joystick Breakout Module
// Module KY023
int JoyStick_X = A0; // x
int JoyStick_Y = A1; // y
int JoyStick_Z = 3; // key
void setup() {
pinMode(JoyStick_X, INPUT);
pinMode(JoyStick_Y, INPUT);
pinMode(JoyStick_Z, INPUT_PULLUP);
Serial.begin(9600); // 9600 bps
}
void loop() {
int x, y, z;
x = analogRead(JoyStick_X);
y = analogRead(JoyStick_Y);
z = digitalRead(JoyStick_Z);
Serial.print(x, DEC);
Serial.print(",");
Serial.print(y, DEC);
Serial.print(",");
Serial.println(z, DEC);
delay(100);
}
Reviews
There are no reviews yet.