Forked from Uwe Gartmann's ADXL345 library, customized as part of the 9DOF stick from Sparkfun.com
Fork of ADXL345 by
ADXL345 is triple axis, digital interface, accelerometer.
This library is forked from Uwe Gartmann and Peter Swanson's work.
This library is for specific application using 9DoF-Stick.
Datasheet:
http://www.analog.com/static/imported-files/data_sheets/ADXL345.pdf
ADXL345は3軸のデジタルインターフェースを備えた加速度センサです。
このライブラリは 9DoF-Stick を使用した特定の企画のために保守しています。
mbed IDEが日本語をサポートするまでは英語でコメントを書いていきますが、サポートした後もきっと英語で書いていくでしょう。
Diff: ADXL345.cpp
- Revision:
- 5:122a504fcfa3
- Parent:
- 4:8046894b947e
--- a/ADXL345.cpp Mon Sep 17 10:39:19 2012 +0000 +++ b/ADXL345.cpp Sat Sep 29 14:15:24 2012 +0000 @@ -54,7 +54,16 @@ //#include "mbed.h" -ADXL345::ADXL345(PinName sda, PinName scl) : i2c_(sda, scl) { +ADXL345::ADXL345(PinName sda, PinName scl) : i2c_(*(new I2C(sda, scl))) { + myI2c = &i2c_; +} + +ADXL345::~ADXL345(){ + delete myI2c; +} + + +void ADXL345::init(){ //400kHz, allowing us to use the fastest data rates. //there are other chips on board, sorry