Ks0008 keyestudio Joystick Module: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
==Introduction==
==Introduction==
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. This joystick module can be easily connected to Arduino by IO Shield. This module is for Arduino(V5) with cables supplied. 
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. This joystick module can be easily connected to Arduino by IO Shield. This module is for Arduino(V5) with cables supplied. 
<br>[[File:Joystick.png|500px|frameless|middle|thumb]]<br>
<br>[[File:Joystick.png|500px|frameless|thumb]]<br>


Xadow is a small but perfectly formed Arduino(TM) compatible board series containing several modules. It's a kit extremely suitable for space-sensitive projects such as wearable devices & arts designs, which have higher request on size, weight and flexible cascade connection.
You can find more modules [http://www.seeedstudio.com/wiki/Xadow here].<br>


==Specification==
==Specification==
*Work Voltage: 3.3V
*Supply Voltage: 3.3V to 5V
*FundamentalFrequency: 2700Hz
*Interface: Analog x2, Digital x1
*Sound Pressure Level: >75dB
*Size: 40*28mm
*Dimensions: 25.43mm x 20.35mm
*Weight: 12g


==Demonstration ==
==Connection Diagram ==
There is an easy demo to show how to drive buzzer sound. If you have successfully used it, then you can apply it to your great projects, such as detecting the battery status: the buzzer will emit a sound when Xadow Main Board is in low battery.


[[File:Joystick.jpg|600px]]  
<br>[[File:Diagram.png|500px|frameless|thumb]]<br>
 
 
==Sample Code ==


<pre>
<pre>
void setup()
int JoyStick_X = 0; //x
int JoyStick_Y = 1; //y
int JoyStick_Z = 3; //key
  void setup()  
{
{
DDRB |= 0x06;
  pinMode(JoyStick_Z, INPUT);  
  Serial.begin(9600); // 9600 bps
}
}
void loop()  
void loop()
{
{
  int x,y,z;
//turn on the buzzer
  x=analogRead(JoyStick_X);
  PORTB |= 0x06;
  y=analogRead(JoyStick_Y);
  delay(1);
  z=digitalRead(JoyStick_Z);
//turn off the buzzer
  Serial.print(x ,DEC);
  PORTB &= ~(0x06);
  Serial.print(",");
  delay(1);
  Serial.print(y ,DEC);
  Serial.print(",");
  Serial.println(z ,DEC);
  delay(100);
}</pre>
}</pre>


==Resource==
*[http://www.seeedstudio.com/wiki/File:Xadow_Buzzer_eagle_file.zip Xadow Buzzer Eagle File]


[[Category: Xadow]]
 
[[Category: Wearable]]
[[Category: Sensor]]
[[Category: Module]]

Revision as of 11:40, 11 August 2016


Introduction

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. This joystick module can be easily connected to Arduino by IO Shield. This module is for Arduino(V5) with cables supplied. 
thumb


Specification

  • Supply Voltage: 3.3V to 5V
  • Interface: Analog x2, Digital x1
  • Size: 40*28mm
  • Weight: 12g

Connection Diagram


thumb


==Sample Code ==
int JoyStick_X = 0; //x
int JoyStick_Y = 1; //y
int JoyStick_Z = 3; //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);
}