Ks0245 keyestudio EASY plug Joystick Module: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
Line 44: Line 44:
==Resources ==
==Resources ==


'''PDF'''
'''File PDF:'''


https://drive.google.com/open?id=1bwMVB2CA3Q-XeBaUQEIpO-Wil4Yu_6pi
https://drive.google.com/open?id=1bwMVB2CA3Q-XeBaUQEIpO-Wil4Yu_6pi

Revision as of 13:15, 29 November 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 the code, 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 value, as the diagram shown below.
thumb

Resources

File PDF:

https://drive.google.com/open?id=1bwMVB2CA3Q-XeBaUQEIpO-Wil4Yu_6pi

Buy from

Official Website

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