add time info to accel msg

eulerConversion
Martin Krauser 2022-03-04 14:07:54 +01:00
parent 7c93796221
commit f0a3c9df44
1 changed files with 7 additions and 7 deletions

View File

@ -58,6 +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 fifoCount; // count of all bytes currently in FIFO
uint8_t fifoBuffer[64]; // FIFO storage buffer
uint32_t time = 0;
// orientation/motion vars
Quaternion q; // [w, x, y, z] quaternion container
@ -174,11 +175,6 @@ void loop() {
qmsg.add(q.y);
qmsg.add(q.z);
qmsg.add(diff.w);
qmsg.add(diff.x);
qmsg.add(diff.y);
qmsg.add(diff.z);
SLIPBTSerial.beginPacket();
qmsg.send(SLIPBTSerial);
SLIPBTSerial.endPacket();
@ -237,10 +233,14 @@ void loop() {
#endif
// Send (accel) over serial
// Send (accel) and time elapsed over serial
int prevTime = time;
time = millis();
msg.add(AcX);
msg.add(AcY);
msg.add(AcZ);
msg.add(time - prevTime);
SLIPSerial.beginPacket();
msg.send(SLIPSerial);