Ks0245 keyestudio EASY plug Joystick Module

From Keyestudio Wiki
Revision as of 09:01, 25 July 2017 by Keyestudio (talk | contribs) (Created page with "==EASY plug Joystick Module== <br>500px|frameless|thumb<br> ==Introduction== EASY plug Joystick Module needs to used with the EASY plug Control board V2...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

EASY plug Joystick Module


thumb

Introduction

EASY plug Joystick Module needs to used with the EASY plug Control board V2.0 control board. The module is connected to the joystick module interface with one line, which is very easy and convenient. Lots of robot projects need joystick. This module provides an affordable solution. By simply connecting to two analog inputs, the robot is at your commands with X, Y control. It also has a switch that is connected to a digital pin.

Specification

  • Supply Voltage:5V
  • Interface: joystick module port
  • Weight: 12.6g

Connection Diagram


thumb

Sample Code

int JoyStick_X = 6; //x
int JoyStick_Y = 7; //y
int JoyStick_Z = 2; //key
  void setup() 
{
  pinMode(JoyStick_Z, INPUT); 
  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);
}

Result

After connecting the power and burning thecode, please open the serial monitor, and set the baud rate of 9600, turn the joystick, press the rocker button, and you can see the different results, as the diagram shown below.
thumb

Resources

Datasheet http://www.keyestudio.com/files/index/download/id/1500367714/

Buy from

http://www.keyestudio.com/easy-plug-joystick-module.html