-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClub.cpp
More file actions
65 lines (55 loc) · 1.08 KB
/
Club.cpp
File metadata and controls
65 lines (55 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Club.cpp
*
* Created on: 30 mai 2018
* Author: sfleury
*/
#include "Club.h"
#include "MPU9250.h"
Club::Club() {
IMU = new MPU9250(Wire, 0x68);
}
Club::~Club() {
// TODO Auto-generated destructor stub
}
void Club::init() {
int status = IMU->begin();
if (status < 0) {
// Serial.println("IMU initialization unsuccessful");
// Serial.println("Check IMU wiring or try cycling power");
// Serial.print("Status: ");
// Serial.println(status);
while (1) {
}
}
// IMU->setGyroBiasX_rads(0);
// IMU->setGyroBiasY_rads(0);
// IMU->setGyroBiasZ_rads(0);
// IMU->calibrateAccel();
// IMU->calibrateGyro();
// IMU->calibrateMag();
}
int Club::readSensor() {
return IMU->readSensor();
}
float Club::getGyroX() {
return IMU->getGyroX_rads();
}
float Club::getGyroY() {
return IMU->getGyroY_rads();
}
float Club::getGyroZ() {
return IMU->getGyroZ_rads();
}
float Club::getAccelX_mss() {
return IMU->getAccelX_mss();
}
float Club::getAccelY_mss() {
return IMU->getAccelY_mss();
}
float Club::getAccelZ_mss() {
return IMU->getAccelZ_mss();
}
MPU9250* Club::getMPU() {
return IMU;
}