Skip to content
Permalink
Browse files

Make sure we init the ADXL before attempting to calibrate.

  • Loading branch information...
ewdicus committed Jul 13, 2015
1 parent 7ff3176 commit 9f4a838dcf0641c45e606e083eae89888ca6d1e7
Showing with 3 additions and 0 deletions.
  1. +3 −0 WireGarden/library/wgDevices.h
@@ -1920,6 +1920,9 @@ class ADXL345Device : public Device {
// or other movements. It will read the acceleration in all axes and calculate the
// offset necessary to bring x and y as close to 0, and z as close to 1, as possible.
void calibrate() {
if (_adxl == NULL){
init();
}

// get sum of 100 readings
_adxl->setAxisOffset( 0, 0, 0 );

0 comments on commit 9f4a838

Please sign in to comment.
You can’t perform that action at this time.