Electronic Components Datasheet Search
  English  ▼

X  

DEV-09760 Datasheet(PDF) 7 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) 7 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
 7 / 9 page
background image
void setup() {
pinMode(PIN_BUTTON_RIGHT, INPUT);
digitalWrite(PIN_BUTTON_RIGHT, HIGH);
pinMode(PIN_BUTTON_LEFT, INPUT);
digitalWrite(PIN_BUTTON_LEFT, HIGH);
pinMode(PIN_BUTTON_UP, INPUT);
digitalWrite(PIN_BUTTON_UP, HIGH);
pinMode(PIN_BUTTON_DOWN, INPUT);
digitalWrite(PIN_BUTTON_DOWN, HIGH);
pinMode(PIN_BUTTON_SELECT, INPUT);
digitalWrite(PIN_BUTTON_SELECT, HIGH);
}
See the next section to learn how to read whether a button is pressed or not.
How do I know when a button on the Joystick Shield
has been pressed?
Once you have set up your Arduino to recognize the buttons (see above) you can tell
whether the button is pressed with the digitalRead() function. When the value read is
LOW the button is pressed and when the value is HIGH the button is not pressed.
if (digitalRead(PIN_BUTTON_LEFT) == LOW) {
// Button is pressed
} else {
// Button is not pressed
}
The following complete example will print the state of each button and the value of the
joystick to the Arduino serial console:
Page 7 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