Arduino Sketch Read Accelerometer

Arduino Sketch Read Accelerometer

This sketch is used by Exercise: Read Analog Accelerometer.

Arduino Sketch Read Accelerometer

Full Source Code

The full code is all in one file ReadAccelerometer.ino.

// ReadAccelerometer - read a 3-axis analog accelerometer and display the results to the serial port
//
// Copyright (c) 2016, Garth Zeglin.  All rights reserved. Licensed under the
// terms of the BSD 3-clause license as included in LICENSE.
//
// This program assumes that:
//
//  1. A three-axis analog accelerometer such as an ADXL335 is attached to A0,
//     A1, and A2.  Note: this sensor has buffered voltage outputs and can
//     simply connect directly to the analog input pins.
//
//  2. The serial console on the Arduino IDE is set to 9600 baud communications speed.
//
// ================================================================================
// Configure the hardware once after booting up.  This runs once after pressing
// reset or powering up the board.

Read more: Arduino Sketch ReadAccelerometer

Leave a Comment

Your email address will not be published. Required fields are marked *