![](https://online-components.com.my/wp-content/uploads/2021/09/oc-fs-50x50.jpg)
Fast Shipping.
All orders delivered fast
![](https://online-components.com.my/wp-content/uploads/2021/09/oc-qp-50x50.jpg)
Quality Products.
Products tested for quality
![](https://online-components.com.my/wp-content/uploads/2021/09/oc-sp-50x50.jpg)
Secure Payments.
Pay online securely with ssl
![](https://online-components.com.my/wp-content/uploads/2021/09/oc-cs-50x50.jpg)
Customer Support.
We answer all your questions
Features:
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.
Pin Definition:
Pin | # | KEY |
---|---|---|
D0(RX) | 0 | NULL |
D1(TX) | 1 | NULL |
D2 | 2 | KEY A |
D3 | 3 | KEY B |
D4 | 4 | KEY C |
D5 | 5 | KEY D |
D6 | 6 | KEY E |
D7 | 7 | KEY F |
D8 | 8 | KEY Down |
Pin | # | KEY |
---|---|---|
D9 | 9 | SCLK |
D10 | 10 | CSN |
D11 | 11 | D/C |
D12 | 12 | RST |
D13 | 13 | SCE |
Pin | # | KEY |
---|---|---|
D9 | 9 | SCE |
D10 | 10 | CSN |
D11 | 11 | SCK |
D12 | 12 | MOSI |
D13 | 13 | MISO |
Arduino Testing Code:
int FirstShotX , FirstShotY; void setup() { for(int i=2; i<9; i++) { pinMode(i, INPUT); digitalWrite(i, 1); } 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) { flag =1; break; } } if(flag == 1) { switch(i) { 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; } 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) { FirstShotY = sensorValue; Serial.print("FirstShotY = "); Serial.println(FirstShotY); } Serial.print("Y = "); Serial.println(sensorValue - FirstShotY); delay(200); }
Reference Video:
Only logged in customers who have purchased this product may leave a review.
All orders delivered fast
Products tested for quality
Pay online securely with ssl
We answer all your questions
Official Online Component online store. Get the best quality components for your next project with us.
No account yet?
Create an Account
Reviews
There are no reviews yet.