Electronic Components Datasheet Search
  English  ▼

X  

DEV-09760 Datasheet(PDF) 2 Page - SparkFun Electronics

Part # DEV-09760
Description  Joystick Shield Quickstart Guide
PDF  9 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  SPARKFUN [SparkFun Electronics]
Direct Link  https://www.sparkfun.com/
Logo SPARKFUN - SparkFun Electronics

DEV-09760 Datasheet(HTML) 2 Page - SparkFun Electronics

  DEV-09760 Datasheet HTML 1Page - SparkFun Electronics DEV-09760 Datasheet HTML 2Page - SparkFun Electronics DEV-09760 Datasheet HTML 3Page - SparkFun Electronics DEV-09760 Datasheet HTML 4Page - SparkFun Electronics DEV-09760 Datasheet HTML 5Page - SparkFun Electronics DEV-09760 Datasheet HTML 6Page - SparkFun Electronics DEV-09760 Datasheet HTML 7Page - SparkFun Electronics DEV-09760 Datasheet HTML 8Page - SparkFun Electronics DEV-09760 Datasheet HTML 9Page - SparkFun Electronics  
Zoom Inzoom in Zoom Outzoom out
 2 / 9 page
background image
• Basic Arduino code (printing joystick values and button presses to the console)
• Crazy Arduino code (controlling a melody and tempo with the joystick)
• Basic Processing code (basic Processing integration)
• Advanced Processing code (painting on a window)
If you have no idea what to do with a joystick, checkout this video:
How do I make it work?
Once you've got the shield assembled, you can begin to change the example code to
make the joystick do your bidding:
• How do I find the current position of the joystick?
• How do I find the current direction of the joystick?
• How do I set up the Arduino so I can know when a button has been pushed on
the Joystick Shield?
• How do I know when a button on the Joystick Shield has been pressed?
• How can I avoid repeating the setup code for each button?
• How can I use the joystick with Processing (and Firmata)?
How do I find the current position of the joystick?
The position of the joystick is calculated from the two potentiometers in the joystick.
The joystick can move in two dimensions which typically would represent X and Y
coordinates but could represent any two dimensional quantity. To read the
potentiometers we use the analogRead() function which returns a number from 0 to
1023. We need to supply an analog pin number to the function—for the joystick shield
the X position is read from analog pin 0 and the Y position is read from analog pin 1:
Serial.println(analogRead(0)); // Prints current X position
Serial.println(analogRead(1)); // Prints current Y position
It is a good technique—because it clarifies your intent—to use ''constants'' for values
that will not change when your sketch runs. With this in mind, the following sketch
snippet sets up constants for the analog pins used and prints the current X and Y
positions to the serial console:
Page 2 of 9



Html Pages

1 2 3 4 5 6 7 8 9


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com