Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
Arduino - Détection de mouvement par accéléromètre-A Quick-Start Guide

Arduino - Détection de mouvement par accéléromètre-A Quick-Start Guide

Ratings: (0)|Views: 461|Likes:
Published by LaFlibuste
Arduino - Détection de mouvement par accéléromètre-A Quick-Start Guide
Arduino - Détection de mouvement par accéléromètre-A Quick-Start Guide

More info:

Published by: LaFlibuste on Apr 09, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/04/2012

pdf

text

original

 
Chapter 6
Building a Motion-Sensing GameController
It’s astonishing how quickly we get used to new technologies. A decadeago, not many people would have imagined that we’d use devices some-day to unobtrusively follow our movements. Today it’s absolutely nor-mal for us to physically turn our smartphones when we want to changefrom portrait to landscape view. Even small children intuitively know how to use motion-sensing controllers for video game consoles such asNintendo’s Wii. You can build your own motion-sensing devices usingan Arduino, and in this chapter you’ll learn how. We’ll work with one of the most widespread motion-sensing devices: the
accelerometer 
. Accelerometers detect movement in all directions—they notice if you move them up, down, forward, backward, to the left, or tothe right. Many popular gadgets such as the iPhone and the Nintendo Wii controllers contain accelerometers. That’s why accelerometers arecheap.Both fun and serious projects can benefit from accelerometers. When working with your computer, you certainly think of projects such asgame controllers or other input control devices. But you can also usethem when exercising or to control a real-life marble maze. You can alsouse them to measure acceleration more or less indirectly, such as in a car. You will learn how to interpret accelerometer data correctly and how toget the most accurate results. Then you’ll use an accelerometer to build your own motion-sensing game controller, and you’ll implement a gamethat uses it.
 
 
 W 
HA
OU
N
EED
133
!"#$%
Figure 6.1: All the parts you need in this chapter 
6.1 What You Need
1. A half-size breadboard or—even better—an Arduino Prototypingshield with a tiny breadboard2. An ADXL335 accelerometer 3. A pushbutton4. A 10k 
resistor 5. Some wires6. An Arduino board such as the Uno, Duemilanove, or Diecimila 7. A USB cable to connect the Arduino to your compute8. A 6 pin 0.1" standard heade
Re ort erratum
 
 
 W 
IRING
U
P THE
CCELEROMETER 
134
Figure 6.2: An ADXL335 sensor on a breakout board
6.2 Wiring Up the Accelerometer
 There are many different accelerometers, differing mainly in the num- ber of spacial axes they support (usually two or three). We use the ADXL335 from Analog Devices—it’s easy to use and widely available.
1
In this section, we’ll connect the ADXL335 to the Arduino and createa small demo program showing the raw data the sensor delivers. At that point, we will have a quick look at the sensor’s specification andinterpret the data.In Figure6.2, you see a breakout board containing an ADXL335 sensor on the right. The sensor is the small black integrated circuit (IC), andthe rest is just a carrier to allow connections. On the top, you see a 6pin 0.1" standard header. The sensor has six connectors labeled GND,Z, Y, X, 3V, and TEST. To use the sensor on a breadboard, solder thestandard header to the connectors. This not only makes it easier toattach the sensor to a breadboard but also stabilizes the sensor, so it 
1.
http://www.analog.com/en/sensors/inertial-sensors/adxl335/products/product.html
Re ort erratum
 

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->