Tutorial.EsploraAccelerometer History

Hide minor edits - Show changes to output

December 24, 2012, at 02:56 AM by Tom Igoe -
Changed lines 13-15 from:
Only your Arduino Espora is needed for this example. Connect the Esplora to your computer with a USB cable and open the Arduino's Serial Monitor.

to:
Only your Arduino Esplora is needed for this example. Connect the Esplora to your computer with a USB cable and open the Arduino's Serial Monitor.

December 24, 2012, at 02:49 AM by Tom Igoe -
Changed lines 31-33 from:
x: 6 y: -128 z: 27
x: 2 y: -138 z: 19
x: 9 y: -137 z: 20
to:
x: 6 y: -128 z: 27
x: 2 y: -138 z: 19
x: 9 y: -137 z: 20
December 24, 2012, at 02:48 AM by Tom Igoe -
Deleted line 33:
x: -20 y: -7 z: -44
December 24, 2012, at 02:48 AM by Tom Igoe -
Changed line 34 from:
x: -20 y: -7 z: -44
to:
x: -20 y: -7 z: -44
Changed line 44 from:
* [[/Reference/EsploraReadAccelerometer | Esplora.readAccelerometer]]()
to:
* [[/Reference/EsploraReadAccelerometer | Esplora.readAccelerometer]]()
December 24, 2012, at 02:47 AM by Tom Igoe -
Changed lines 29-32 from:
@@x: 512 y: 567 z: 634@@\\
@@x: 513 y: 563 z: 632@@

to:

[@
x: 6 y: -128 z: 27
x: 2 y: -138 z: 19
x: 9 y: -137 z: 20
x: -20 y: -7 z: -44
@]

December 24, 2012, at 02:44 AM by Tom Igoe -
Changed lines 13-18 from:
Connect the Esplora to your computer with a USB cable and open the Arduino's Serial Monitor.
to:
Only your Arduino Espora is needed for this example. Connect the Esplora to your computer with a USB cable and open the Arduino's Serial Monitor.


%height=350px%[[Attach:Esplora_Accelerometer.png | Attach:Esplora_Accelerometer.png]]
[- Accelerometer to send data to your computer from the Esplora-]
Deleted line 39:
December 23, 2012, at 06:39 PM by Scott Fitzgerald -
Changed lines 24-27 from:
@@x: 512 y: 567 z: 634
x: 513 y: 563 z: 632@@

to:
@@x: 512 y: 567 z: 634@@\\
@@x: 513 y: 563 z: 632@@

December 23, 2012, at 06:38 PM by Scott Fitzgerald -
Changed lines 23-26 from:
To send the values to the Serial Monitor, you call [[Serial/print | Serial.print]](). When the Esplora is connected, and the Serial Monitor is open, you should start to see values reported like this twice a second :
@@x: 512 y: 567 z: 634@@

to:
To send the values to the Serial Monitor, you call [[Serial/print | Serial.print]](). When the Esplora is connected, and the Serial Monitor is open, you should start to see values reported like this twice a second :\\
@@x: 512 y: 567 z: 634
x: 513 y: 563 z: 632@@

Changed lines 34-40 from:
* [[Reference/EsploraWriteRGB | writeRGB()]]
* [[Reference/EsploraWriteRed| writeRed()]]
* [[Reference/EsploraWriteRed | writeGreen()]]
* [[Reference/EsploraWriteRed | writeBlue()]]

* [[Tutorial/EsploraLedShow | EsploraLedShow]]
* [[Tutorial/EsploraLedShow2 | EsploraLedShow2]]
to:
* [[/Reference/EsploraReadAccelerometer | Esplora.readAccelerometer]]()
December 23, 2012, at 06:36 PM by Scott Fitzgerald -
Added lines 1-39:
''Examples > Esplora''

!!!Esplora Accelerometer

This sketch shows you how to read the values from the accelerometer. To see it in action, open the Arduino serial monitor on your computer and tilt the board. You'll see the accelerometer values for each axis change as you tilt the board.

(:div class=BOM :)
!!!Hardware Required
* Arduino Esplora
(:divend:)

!!!Circuit
Connect the Esplora to your computer with a USB cable and open the Arduino's Serial Monitor.
(:divend:)


!!!Code

To send data to your computer, you need to open a serial connection. use [[/Serial/Begin | Serial.begin]]() to open a serial port at 9600 baud on the Esplora.

The [[/Reference/EsploraReadAccelerometer | Esplora.readAccelerometer]]() function gets the values from the accelerometer. It needs an argument telling it what axis you're reading from: X_AXIS, Y_AXIS, or Z_AXIS. Each axis will give you a value between 0 and 1023.

To send the values to the Serial Monitor, you call [[Serial/print | Serial.print]](). When the Esplora is connected, and the Serial Monitor is open, you should start to see values reported like this twice a second :
@@x: 512 y: 567 z: 634@@


(:div class=code :)
(:source https://raw.github.com/arduino/Arduino/master/libraries/Esplora/examples/Beginners/EsploraAccelerometer/EsploraAccelerometer.ino lang=arduino tabwidth=4:)
(:divend:)


!!!See Also:
* [[Reference/EsploraWriteRGB | writeRGB()]]
* [[Reference/EsploraWriteRed| writeRed()]]
* [[Reference/EsploraWriteRed | writeGreen()]]
* [[Reference/EsploraWriteRed | writeBlue()]]

* [[Tutorial/EsploraLedShow | EsploraLedShow]]
* [[Tutorial/EsploraLedShow2 | EsploraLedShow2]]

Share