Ks0245 keyestudio EASY plug Joystick Module: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
(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...")
 
Line 45: Line 45:


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



Revision as of 16:27, 27 September 2017

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