-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (31 loc) · 776 Bytes
/
main.cpp
File metadata and controls
44 lines (31 loc) · 776 Bytes
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
#include "RBCX.h"
#include <Arduino.h>
#include <string>
void clear() {
rb::Manager::get().oled().fill(rb::Oled::Black);
rb::Manager::get().oled().updateScreen();
}
void waitToNextTest() {
delay(3000);
clear();
}
void setup() {
printf("RB3204-RBCX\n");
delay(500);
printf("Init manager\n");
auto& man = rb::Manager::get();
man.install();
man.leds().red(true);
auto& mpu = rb::Manager::get().mpu();
mpu.init();
// sets the 0 positions to current RBCX orientation
mpu.calibrateNow();
delay(1000);
mpu.sendStart();
while (true) {
auto angle = mpu.getAngle();
printf("MPU - angle: X: %2.2f Y: %2.2f Z: %2.2f\n", angle.x, angle.y, angle.z);
delay(100);
}
}
void loop() {}