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.
JON_IMU/IMU.h
- Committer:
- jcytam
- Date:
- 2012-02-23
- Revision:
- 0:0309bb86b703
File content as of revision 0:0309bb86b703:
#ifndef IMU_H #define IMU_H //****************************************************************************/ // Includes //****************************************************************************/ #include "mbed.h" //****************************************************************************/ // Defines //****************************************************************************/ #define Rad2Deg 57.2957795 #define ZERO_G 1.65 class IMU { public: IMU(PinName XGyro, PinName YAccel, PinName ZAccel, PinName AZ); void initialise(void); void update(void); float getRoll(void); float getGyrox(void); float getAccelx(void); private: float X, Y, Z, Xrate, Yrate, Gyro_offset; float GYROX_accom, GYROY_accom; float AccAngleX, AccAngleY, AccAngleZ, GyroAngleX, GyroAngleY; float Roll, Pitch; Timer t; AnalogIn _XGyro; AnalogIn _YAccel; AnalogIn _ZAccel; DigitalOut _AZ; float reading[100]; float w, median ; long middle, samples; void Median(void); }; #endif