Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Accelerometer.h
00001 #ifndef ACCELEROMETER_H 00002 #define ACCELEROMETER_H 00003 00004 #include <math.h> 00005 00006 #include "ADXL345.h" 00007 00008 class Accelerometer 00009 { 00010 public: 00011 Accelerometer(ADXL345* acceleHardware, float sensitivity); 00012 ~Accelerometer(void); 00013 00014 void updateZeroRates(); 00015 00016 void update(); 00017 void update(int samplesSize, int sampleDataRate, bool iswait); 00018 00019 float getAccelerationX(); 00020 float getAccelerationY(); 00021 float getAccelerationZ(); 00022 00023 float getRadiansAngleX(); 00024 float getRadiansAngleY(); 00025 00026 float getDegreesAngleX(); 00027 float getDegreesAngleY(); 00028 00029 static float getPI(); 00030 00031 private: 00032 ADXL345* acceleHardware; 00033 00034 float sensitivity; 00035 float zeroRateX, zeroRateY, zeroRateZ; 00036 00037 float rawX; 00038 float rawY; 00039 float rawZ; 00040 }; 00041 00042 #endif
Generated on Tue Jul 19 2022 01:26:58 by
1.7.2