Ks0008 keyestudio Joystick Module: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:


 
<br>
==Introduction==
==Introduction==
This is a Xadow module which can emit a tone. To drive it, you need to give control to two pins simultaneously: this is different from Grove - Buzzer which uses one pin to control. It is petite but loud! It can be used for making beeps, tones and alerts.<br>
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. <br>
<br>[[File:Joystick.png|500px|thumb]]<br />
It also has a switch that is connected to a digital pin. This joystick module can be easily connected to Arduino by IO Shield.  
 
<br>[[File:Ks0008_joystick.png|600px|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>


<br>
==Specification==
==Specification==
*Work Voltage: 3.3V
*Supply Voltage: 3.3V to 5V
*FundamentalFrequency: 2700Hz
*Interface: Analog x2, Digital x1
*Sound Pressure Level: >75dB
*Dimensions: 25.43mm x 20.35mm
 
==Demonstration ==
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>
==Connection Diagram ==
<br>[[File:Ks0008-1.png|700px|frameless|thumb]]<br>


<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);
}</pre>
  Serial.print(",");
  Serial.println(z ,DEC);
  delay(100);
}
</pre>
 
<br>
==Result==
<br>[[File:36.png|600px|frameless|thumb]]<br>
Wiring well and uploading the code, open the serial monitor and set the baud rate to 9600, push the joystick, you will see the value shown below.
 
<br>[[File:Joystick 1.jpg|600px|frameless|thumb]]<br>
 
<br>
==Resources ==
 
'''Video''' <br>
http://video.keyestudio.com/ks0008/
 
'''PDF and Code''' <br>
https://fs.keyestudio.com/KS0008
 
 
<br>
 
==Get One Now ==
*[https://www.keyestudio.com/free-shipping-keyestudio-ps2-joystick-module-compatible-with-arduino-p0468-p0468.html    '''Get From Official Website''' ]
 
*[https://www.aliexpress.com/store/product/Free-shipping-Dual-axis-XY-Joystick-module-for-Arduino/1452162_2053015123.html?spm=2114.12010615.8148356.1.41412b93TeG5T7  '''From Aliexpress''']


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


[[Category: Xadow]]
<br>
[[Category: Wearable]]
[[Category: Module]]

Latest revision as of 11:18, 8 January 2021


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.
thumb


Specification

  • Supply Voltage: 3.3V to 5V
  • Interface: Analog x2, Digital x1


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);
}


Result


thumb
Wiring well and uploading the code, open the serial monitor and set the baud rate to 9600, push the joystick, you will see the value shown below.


thumb


Resources

Video
http://video.keyestudio.com/ks0008/

PDF and Code
https://fs.keyestudio.com/KS0008



Get One Now