fixed bugs
parent
db434f18b7
commit
81410a9b68
|
@ -58,7 +58,7 @@ uint8_t devStatus; // return status after each device operation (0 = succes
|
||||||
uint16_t packetSize; // expected DMP packet size (default is 42 bytes)
|
uint16_t packetSize; // expected DMP packet size (default is 42 bytes)
|
||||||
uint16_t fifoCount; // count of all bytes currently in FIFO
|
uint16_t fifoCount; // count of all bytes currently in FIFO
|
||||||
uint8_t fifoBuffer[64]; // FIFO storage buffer
|
uint8_t fifoBuffer[64]; // FIFO storage buffer
|
||||||
uint32_t time = 0;
|
unsigned long timeOn = 0;
|
||||||
|
|
||||||
// orientation/motion vars
|
// orientation/motion vars
|
||||||
Quaternion q; // [w, x, y, z] quaternion container
|
Quaternion q; // [w, x, y, z] quaternion container
|
||||||
|
@ -85,6 +85,7 @@ OSCMessage gmsg("/gyro/");
|
||||||
OSCMessage emsg("/error/");
|
OSCMessage emsg("/error/");
|
||||||
OSCMessage kmsg("/keys/");
|
OSCMessage kmsg("/keys/");
|
||||||
OSCMessage quaternionMessage("/quaternion/");
|
OSCMessage quaternionMessage("/quaternion/");
|
||||||
|
OSCMessage quaternionDiffMessage("/quaternionDiff/");
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Wire.begin();
|
Wire.begin();
|
||||||
|
@ -250,12 +251,17 @@ void loop() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Send (accel) and time elapsed over serial
|
// Send (accel) and time elapsed over serial
|
||||||
int prevTime = time;
|
int prevTime = timeOn;
|
||||||
time = millis();
|
timeOn = millis();
|
||||||
|
int elapsedTime = timeOn - prevTime;
|
||||||
|
|
||||||
|
mpu.dmpGetGravity(&gravity, &q);
|
||||||
|
mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
|
||||||
|
AcX = aaReal.x;
|
||||||
msg.add(AcX);
|
msg.add(AcX);
|
||||||
msg.add(AcY);
|
msg.add(AcY);
|
||||||
msg.add(AcZ);
|
msg.add(AcZ);
|
||||||
msg.add(time - prevTime);
|
msg.add(elapsedTime);
|
||||||
|
|
||||||
|
|
||||||
SLIPSerial.beginPacket();
|
SLIPSerial.beginPacket();
|
||||||
|
|
Loading…
Reference in New Issue