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.
Imu.h
- Committer:
- takeru0x1103
- Date:
- 2018-12-01
- Revision:
- 18:5aa48aec9cae
- Parent:
- Gyro.h@ 17:f9610f3cfa1b
- Child:
- 19:4b0fe9a5ec38
File content as of revision 18:5aa48aec9cae:
#ifndef __IMU_H__
#define __IMU_H__
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
#include "mbed.h"
#include "typedef.h"
class Imu {
private:
const float cGYRO_RESO=131.0;
Serial sp46Axis; //
INT16 gyroZ;
INT16 gyro_ref;
float yaw;
float yaw_ref;
float yawOfset;
//
void PushBuf(UCHAR rxChar);
void uartRxIntHndler46Axis();
float wrapAroungGuard(float iYaw);
public:
Imu(PinName pinTx, PinName pinRx);
virtual ~Imu();
float GetGyroZ();
float GetYaw();
void CalYaw();
void CalGyro();
};
#endif