Joystick XY duo axis with button module KY-023

(1 customer review)

1,95

Joystick XY duo axis module KY-023

5 in stock

SKU: HE0165-001 Categories: , Tags: , , , , Send:

Description

Joystick XY duo axis with button module KY-023. Add this to your robot, smart car or game project for control. Easy to connect to an Arduino with 2 analog pins for XY control. The button can be connected to a digital pin.

Arduino code example:

int sensorPin = 5;
int value = 0;

void setup() {
  pinMode(3, 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);
}

1 rating for Joystick XY duo axis with button module KY-023

  1. Nathan -

    The pin you connect your SW to must use an internal pullup resistor.
    Below is the modified code:

    int sensorPin = 7;
    int value = 0;

    void setup () {
    pinMode(sensorPin, INPUT_PULLUP);
    Serial.begin (9600);
    }

    void loop () {
    value = analogRead(A0);
    Serial.print(“X:”);
    Serial.print(value, DEC);

    value = analogRead(A1);
    Serial.print(” | Y:”);
    Serial.print(value, DEC);

    value = digitalRead(sensorPin);
    Serial.print(” | Z: “);
    Serial.println(value, DEC);

    delay (100);
    }

Only logged in customers who have purchased this product may leave a review.

Shipping within the Netherlands

This product will be delivered via PostNL parcel post.
- €6.95 shipping costs for orders under €100.
- Orders above € 100,- will be free of charge sent.
- You can also use parcel convenience. More information about parcel convenience

  • Ordered before 16:30 PM on workdays, shipped the same day!
    Click here for costs outside the Netherlands.
  • Product question?

      Your Name (required)

      Your Email (required)

      your question

      You may also like ...