SlideShare a Scribd company logo
www.researchdesignlab.com Page 1
JOYSTICK SHIELD
JOYSTICK SHIELD
www.researchdesignlab.com Page 2
JOYSTICK SHIELD
Table of Contents
OVERVIEW ................................................................................................................................... 3
INTRODUCTION ...................................................................................................................... 3
FEATURES ................................................................................................................................ 3
ARDUINO CODE ...................................................................................................................... 4
OUTPUT..................................................................................................................................... 7
RELATED PRODUCTS ............................................................................................................ 8
www.researchdesignlab.com Page 3
JOYSTICK SHIELD
OVERVIEW
INTRODUCTION
The Joystick Shield easily stacks on top of your ATmega 328 and turns it into a simple robotic
and gaming controller. Six momentary push buttons (4+2), a two-axis thumb joystick and
optional remote transmission adapter for Xbee and Bluetooth allows your ATmega 328 to
control from remote location.
ATmega 328 digital pins D3-D8 are connected to momentary push buttons, when pressed they
will pull the pin HIGH. Voltage accross analog pin 0 varies proportionally for the vertical
movement of the joystick, like wise horizontal movement can be tracked at analog pin 1.Xbee
Dout is connected to D0(Rx) and Din is connected to D1(Tx) of ATmega 328 sheild.
FEATURES
 Jumbo yellow 4 keypad.
 Joystick.
 Two selection switch.
 RoHS compliant.
 Compatible with UNO R3 and Mega 2560.
 High quality PCB FR4 Grade with FPT Certified.
www.researchdesignlab.com Page 4
JOYSTICK SHIELD
ARDUINO CODE
/*
* Project name:
Joystick Shield
* Copyright
(c) Researchdesignlab.com
* Description:
* Test configuration:
MCU: ATMEGA328
Dev.Board: Arduino uno
Oscillator: 16 MHz
Software: Arduino
*/
const int analogInPin1 = A0; // Analog input pin that the potentiometer is
attached to x axis Joystick
const int analogInPin2 = A1; // Analog input pin that the potentiometer is
attached to y axis Joystick
const int buttonPin_A = 3; // the number of the pushbutton A pin
const int buttonPin_B = 4; // the number of the pushbutton B pin
const int buttonPin_C = 5; // the number of the pushbutton C pin
const int buttonPin_D = 6; // the number of the pushbutton D pin
const int buttonPin_E = 7; // the number of the pushbutton E pin
const int buttonPin_F = 8; // the number of the pushbutton F pin
int sensorValue = 0; // value read from the pot
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
Serial.println("Joystick Shield with XBEE RDL ");
Serial.println(" " );
// initialize the pushbutton pin as an input:
pinMode(buttonPin_A, INPUT);
pinMode(buttonPin_B, INPUT);
pinMode(buttonPin_C, INPUT);
www.researchdesignlab.com Page 5
JOYSTICK SHIELD
pinMode(buttonPin_D, INPUT);
pinMode(buttonPin_E, INPUT);
pinMode(buttonPin_F, INPUT);
}
void loop() {
// read the input on analog pin 0 x axis:
sensorValue = analogRead(analogInPin1);
Serial.print("x = " );
Serial.print(sensorValue); // print out the value you read:
// read the input on analog pin 1 y axis:
sensorValue = analogRead(analogInPin2);
Serial.print(" y = " );
Serial.print(sensorValue); // print out the value you read:
// read the state of the pushbutton A value:
buttonState = digitalRead(buttonPin_A);
// check if the pushbutton A is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
Serial.print(" BUTTON A " );
}
// read the state of the pushbutton B value:
buttonState = digitalRead(buttonPin_B);
// check if the pushbutton B is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
Serial.print(" BUTTON B " );
}
// read the state of the pushbutton C value:
buttonState = digitalRead(buttonPin_C);
// check if the pushbutton C is pressed.
// if it is, the buttonState is HIGH:
www.researchdesignlab.com Page 6
JOYSTICK SHIELD
if (buttonState == HIGH) {
Serial.print(" BUTTON C " );
}
// read the state of the pushbutton D value:
buttonState = digitalRead(buttonPin_D);
// check if the pushbutton D is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
Serial.print(" BUTTON D " );
}
// read the state of the pushbutton E value:
buttonState = digitalRead(buttonPin_E);
// check if the pushbutton E is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
Serial.print(" BUTTON E " );
}
// read the state of the pushbutton F value:
buttonState = digitalRead(buttonPin_F);
// check if the pushbutton F is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
Serial.print(" BUTTON F " );
}
Serial.println(" " );
delay(1000);
}
www.researchdesignlab.com Page 7
JOYSTICK SHIELD
OUTPUT
www.researchdesignlab.com Page 8
JOYSTICK SHIELD
RELATED PRODUCTS
4 KEYS KEYPAD XBee
ATMEGA328 DEVELOPMNET BOARD

More Related Content

More from Raghav Shetty

8 Channel Relay Board-Rs485
8 Channel Relay Board-Rs485 8 Channel Relay Board-Rs485
8 Channel Relay Board-Rs485
Raghav Shetty
 
Xbee X-CTU Software
Xbee X-CTU SoftwareXbee X-CTU Software
Xbee X-CTU Software
Raghav Shetty
 
Digitla Vibration Sensor
Digitla Vibration SensorDigitla Vibration Sensor
Digitla Vibration Sensor
Raghav Shetty
 
Thermal Printer
Thermal PrinterThermal Printer
Thermal Printer
Raghav Shetty
 
Digital Soil Moisture Sensor
Digital Soil Moisture SensorDigital Soil Moisture Sensor
Digital Soil Moisture Sensor
Raghav Shetty
 
Micro SD Memory Card Interface for 5V MCU
Micro SD Memory Card Interface for 5V MCUMicro SD Memory Card Interface for 5V MCU
Micro SD Memory Card Interface for 5V MCU
Raghav Shetty
 
Micro SD Memory Card Interface for 3.3V MCU
Micro SD Memory Card Interface for 3.3V MCUMicro SD Memory Card Interface for 3.3V MCU
Micro SD Memory Card Interface for 3.3V MCU
Raghav Shetty
 
Regulated Power Supply
Regulated Power Supply Regulated Power Supply
Regulated Power Supply
Raghav Shetty
 
PIC Project Board
PIC Project BoardPIC Project Board
PIC Project Board
Raghav Shetty
 
8 Channel Bi Directional Logic Level Converter
8 Channel Bi Directional Logic Level Converter8 Channel Bi Directional Logic Level Converter
8 Channel Bi Directional Logic Level Converter
Raghav Shetty
 
LCD Keypad Shield
LCD Keypad ShieldLCD Keypad Shield
LCD Keypad Shield
Raghav Shetty
 
L298 Motor Driver
L298 Motor DriverL298 Motor Driver
L298 Motor Driver
Raghav Shetty
 
Force Sensor
Force SensorForce Sensor
Force Sensor
Raghav Shetty
 
Plastic REED Float Switch
Plastic REED Float SwitchPlastic REED Float Switch
Plastic REED Float Switch
Raghav Shetty
 
Flex Sensor
Flex SensorFlex Sensor
Flex Sensor
Raghav Shetty
 
Serial EEPROM
Serial EEPROMSerial EEPROM
Serial EEPROM
Raghav Shetty
 
DTMF Decoder Shield for Arduino
DTMF Decoder Shield for ArduinoDTMF Decoder Shield for Arduino
DTMF Decoder Shield for Arduino
Raghav Shetty
 
Digital Dimmer Module
Digital Dimmer ModuleDigital Dimmer Module
Digital Dimmer Module
Raghav Shetty
 
Bluetooth Module HC-06
Bluetooth Module HC-06Bluetooth Module HC-06
Bluetooth Module HC-06
Raghav Shetty
 
Barometric Digital pressure Sensor BMP085
Barometric Digital pressure Sensor BMP085Barometric Digital pressure Sensor BMP085
Barometric Digital pressure Sensor BMP085
Raghav Shetty
 

More from Raghav Shetty (20)

8 Channel Relay Board-Rs485
8 Channel Relay Board-Rs485 8 Channel Relay Board-Rs485
8 Channel Relay Board-Rs485
 
Xbee X-CTU Software
Xbee X-CTU SoftwareXbee X-CTU Software
Xbee X-CTU Software
 
Digitla Vibration Sensor
Digitla Vibration SensorDigitla Vibration Sensor
Digitla Vibration Sensor
 
Thermal Printer
Thermal PrinterThermal Printer
Thermal Printer
 
Digital Soil Moisture Sensor
Digital Soil Moisture SensorDigital Soil Moisture Sensor
Digital Soil Moisture Sensor
 
Micro SD Memory Card Interface for 5V MCU
Micro SD Memory Card Interface for 5V MCUMicro SD Memory Card Interface for 5V MCU
Micro SD Memory Card Interface for 5V MCU
 
Micro SD Memory Card Interface for 3.3V MCU
Micro SD Memory Card Interface for 3.3V MCUMicro SD Memory Card Interface for 3.3V MCU
Micro SD Memory Card Interface for 3.3V MCU
 
Regulated Power Supply
Regulated Power Supply Regulated Power Supply
Regulated Power Supply
 
PIC Project Board
PIC Project BoardPIC Project Board
PIC Project Board
 
8 Channel Bi Directional Logic Level Converter
8 Channel Bi Directional Logic Level Converter8 Channel Bi Directional Logic Level Converter
8 Channel Bi Directional Logic Level Converter
 
LCD Keypad Shield
LCD Keypad ShieldLCD Keypad Shield
LCD Keypad Shield
 
L298 Motor Driver
L298 Motor DriverL298 Motor Driver
L298 Motor Driver
 
Force Sensor
Force SensorForce Sensor
Force Sensor
 
Plastic REED Float Switch
Plastic REED Float SwitchPlastic REED Float Switch
Plastic REED Float Switch
 
Flex Sensor
Flex SensorFlex Sensor
Flex Sensor
 
Serial EEPROM
Serial EEPROMSerial EEPROM
Serial EEPROM
 
DTMF Decoder Shield for Arduino
DTMF Decoder Shield for ArduinoDTMF Decoder Shield for Arduino
DTMF Decoder Shield for Arduino
 
Digital Dimmer Module
Digital Dimmer ModuleDigital Dimmer Module
Digital Dimmer Module
 
Bluetooth Module HC-06
Bluetooth Module HC-06Bluetooth Module HC-06
Bluetooth Module HC-06
 
Barometric Digital pressure Sensor BMP085
Barometric Digital pressure Sensor BMP085Barometric Digital pressure Sensor BMP085
Barometric Digital pressure Sensor BMP085
 

Recently uploaded

GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

Joystick Shield

  • 2. www.researchdesignlab.com Page 2 JOYSTICK SHIELD Table of Contents OVERVIEW ................................................................................................................................... 3 INTRODUCTION ...................................................................................................................... 3 FEATURES ................................................................................................................................ 3 ARDUINO CODE ...................................................................................................................... 4 OUTPUT..................................................................................................................................... 7 RELATED PRODUCTS ............................................................................................................ 8
  • 3. www.researchdesignlab.com Page 3 JOYSTICK SHIELD OVERVIEW INTRODUCTION The Joystick Shield easily stacks on top of your ATmega 328 and turns it into a simple robotic and gaming controller. Six momentary push buttons (4+2), a two-axis thumb joystick and optional remote transmission adapter for Xbee and Bluetooth allows your ATmega 328 to control from remote location. ATmega 328 digital pins D3-D8 are connected to momentary push buttons, when pressed they will pull the pin HIGH. Voltage accross analog pin 0 varies proportionally for the vertical movement of the joystick, like wise horizontal movement can be tracked at analog pin 1.Xbee Dout is connected to D0(Rx) and Din is connected to D1(Tx) of ATmega 328 sheild. FEATURES  Jumbo yellow 4 keypad.  Joystick.  Two selection switch.  RoHS compliant.  Compatible with UNO R3 and Mega 2560.  High quality PCB FR4 Grade with FPT Certified.
  • 4. www.researchdesignlab.com Page 4 JOYSTICK SHIELD ARDUINO CODE /* * Project name: Joystick Shield * Copyright (c) Researchdesignlab.com * Description: * Test configuration: MCU: ATMEGA328 Dev.Board: Arduino uno Oscillator: 16 MHz Software: Arduino */ const int analogInPin1 = A0; // Analog input pin that the potentiometer is attached to x axis Joystick const int analogInPin2 = A1; // Analog input pin that the potentiometer is attached to y axis Joystick const int buttonPin_A = 3; // the number of the pushbutton A pin const int buttonPin_B = 4; // the number of the pushbutton B pin const int buttonPin_C = 5; // the number of the pushbutton C pin const int buttonPin_D = 6; // the number of the pushbutton D pin const int buttonPin_E = 7; // the number of the pushbutton E pin const int buttonPin_F = 8; // the number of the pushbutton F pin int sensorValue = 0; // value read from the pot int buttonState = 0; // variable for reading the pushbutton status void setup() { // initialize serial communications at 9600 bps: Serial.begin(9600); Serial.println("Joystick Shield with XBEE RDL "); Serial.println(" " ); // initialize the pushbutton pin as an input: pinMode(buttonPin_A, INPUT); pinMode(buttonPin_B, INPUT); pinMode(buttonPin_C, INPUT);
  • 5. www.researchdesignlab.com Page 5 JOYSTICK SHIELD pinMode(buttonPin_D, INPUT); pinMode(buttonPin_E, INPUT); pinMode(buttonPin_F, INPUT); } void loop() { // read the input on analog pin 0 x axis: sensorValue = analogRead(analogInPin1); Serial.print("x = " ); Serial.print(sensorValue); // print out the value you read: // read the input on analog pin 1 y axis: sensorValue = analogRead(analogInPin2); Serial.print(" y = " ); Serial.print(sensorValue); // print out the value you read: // read the state of the pushbutton A value: buttonState = digitalRead(buttonPin_A); // check if the pushbutton A is pressed. // if it is, the buttonState is HIGH: if (buttonState == HIGH) { Serial.print(" BUTTON A " ); } // read the state of the pushbutton B value: buttonState = digitalRead(buttonPin_B); // check if the pushbutton B is pressed. // if it is, the buttonState is HIGH: if (buttonState == HIGH) { Serial.print(" BUTTON B " ); } // read the state of the pushbutton C value: buttonState = digitalRead(buttonPin_C); // check if the pushbutton C is pressed. // if it is, the buttonState is HIGH:
  • 6. www.researchdesignlab.com Page 6 JOYSTICK SHIELD if (buttonState == HIGH) { Serial.print(" BUTTON C " ); } // read the state of the pushbutton D value: buttonState = digitalRead(buttonPin_D); // check if the pushbutton D is pressed. // if it is, the buttonState is HIGH: if (buttonState == HIGH) { Serial.print(" BUTTON D " ); } // read the state of the pushbutton E value: buttonState = digitalRead(buttonPin_E); // check if the pushbutton E is pressed. // if it is, the buttonState is HIGH: if (buttonState == HIGH) { Serial.print(" BUTTON E " ); } // read the state of the pushbutton F value: buttonState = digitalRead(buttonPin_F); // check if the pushbutton F is pressed. // if it is, the buttonState is HIGH: if (buttonState == HIGH) { Serial.print(" BUTTON F " ); } Serial.println(" " ); delay(1000); }
  • 8. www.researchdesignlab.com Page 8 JOYSTICK SHIELD RELATED PRODUCTS 4 KEYS KEYPAD XBee ATMEGA328 DEVELOPMNET BOARD