
Joystick Shield
Introduction
The Joystick Shield enable your Arduino with a joystick! The shield sits on top of your Arduino and turns it
into a simple controller. Five momentary push buttons (4+ joystick select button) and a two-axis thumb
joystick gives your Arduino functionality on the level of old Nintendo controllers.
This shield is a great piece of uer interface board, it is perfect for gaming and navigating through menu
quickly. It has headers for LCDs and RF modules , to communicating and displays easily.
Application Ideas
Pin definition and Rating
KEY Button Define
Nokoia 5110 LCD
www.openplatform.cc

nRF24L01
Usage
Hardware Installation
Plug JoyStick shield onto the Arduino/Crowduino. Connect the board to PC using USB cable.
Programming
1.Copy the demo code to your sketch, then upload to Arduino or Crowduino board.
int FirstShotX , FirstShotY;
void setup()
{
for(int i=2; i<9; i++)
{
pinMode(i, INPUT);
digitalWrite(i, 1);
}
www.openplatform.cc

Serial.begin(9600);
FirstShotX = 0;
FirstShotY = 0;
}
void loop()
{
int i, someInt, flag = 0;
for(i=2; i<9; i++)
{
someInt = digitalRead(i);
if(someInt == 0)
{
}
}
if(flag == 1)
{
switch(i)
{
}
flag=0;
}
int sensorValue = analogRead(A0);
if(FirstShotX == 0)
{
FirstShotX = sensorValue;
Serial.print("FirstShotX = ");
Serial.println(FirstShotX);
}
Serial.print("X = ");
Serial.println(sensorValue - FirstShotX);
sensorValue = analogRead(A1);
if(FirstShotY == 0)
{
flag =1;
break;
case 2: Serial.println("--------> Button A"); break;
case 3: Serial.println("--------> Button B"); break;
case 4: Serial.println("--------> Button C"); break;
case 5: Serial.println("--------> Button D"); break;
case 6: Serial.println("--------> Button E"); break;
case 7: Serial.println("--------> Button F"); break;
case 8: Serial.println("--------> Button KEY"); break;
default: break;
FirstShotY = sensorValue;
www.openplatform.cc

Serial.print("FirstShotY = ");
Serial.println(FirstShotY);
}
Serial.print("Y = ");
Serial.println(sensorValue - FirstShotY);
delay(200);
}
2.Open the serial monitor. Control the JoyStich Shield,you should see some data from you control.
Resources
http://www.elecfreaks.com/wiki/index.php?title=Joystick_Shield
http://www.elecfreaks.com/1999.html
www.openplatform.cc