EasyManuals Logo

Arduino uno User Manual

Arduino uno
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #120 background imageLoading...
Page #120 background image
breakout board youre using!) Naturally, youll move around the accelerometer
a lot, so its best to use long wires.
Now that weve connected the ADXL335 to the Arduino, lets use it.
Bringing Your Accelerometer to Life
A pragmatic strategy to get familiar with a new device is to hook it up and
see what data it delivers. The following program reads input values for all
three axes and outputs them to the serial port:
MotionSensor/SensorTest/SensorTest.ino
const unsigned int X_AXIS_PIN = A2;
const unsigned int Y_AXIS_PIN = A1;
const unsigned int Z_AXIS_PIN = A0;
const unsigned int BAUD_RATE = 9600;
void setup() {
Serial.begin(BAUD_RATE);
}
void loop() {
Serial.print(analogRead(X_AXIS_PIN));
Serial.print(" ");
Serial.print(analogRead(Y_AXIS_PIN));
Serial.print(" ");
Serial.println(analogRead(Z_AXIS_PIN));
delay(100);
}
Chapter 6. Building a Motion-Sensing Game Controller 102
report erratum discuss
www.it-ebooks.info

Table of Contents

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino uno and is the answer not in the manual?

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals