전자부품 데이터시트 검색엔진
  Korean  ▼
ALLDATASHEET.CO.KR

X  

DEV-09760 데이터시트(PDF) 2 Page - SparkFun Electronics

부품명 DEV-09760
상세설명  Joystick Shield Quickstart Guide
PDF  9 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
제조업체  SPARKFUN [SparkFun Electronics]
홈페이지  https://www.sparkfun.com/
Logo SPARKFUN - SparkFun Electronics

DEV-09760 데이터시트(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


데이터시트 다운로드

Go To PDF Page


링크 URL



ALLDATASHEET 가 귀하에 도움이 되셨나요?  [ DONATE ] 

Alldatasheet는?   |   광고문의   |   운영자에게 연락하기   |   개인정보취급방침   |   링크 투 데이터시트    |   링크교환   |   제조사별 검색
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