diff --git a/osc32bt/osc32bt.ino b/osc32bt/osc32bt.ino index e0c74b8..7968784 100644 --- a/osc32bt/osc32bt.ino +++ b/osc32bt/osc32bt.ino @@ -84,7 +84,7 @@ OSCMessage msg("/accel/"); OSCMessage gmsg("/gyro/"); OSCMessage emsg("/error/"); OSCMessage kmsg("/keys/"); -OSCMessage qmsg("/quaternion/"); +OSCMessage quaternionMessage("/quaternion/"); void setup() { Wire.begin(); @@ -170,20 +170,36 @@ void loop() { //oscmsg = qOSC(q.w, q.x, q.y, q.z, diff.w, diff.x, diff.y, diff,z); - qmsg.add(q.w); - qmsg.add(q.x); - qmsg.add(q.y); - qmsg.add(q.z); + quaternionMessage.add(q.w); + quaternionMessage.add(q.x); + quaternionMessage.add(q.y); + quaternionMessage.add(q.z); SLIPBTSerial.beginPacket(); - qmsg.send(SLIPBTSerial); + quaternionMessage.send(SLIPBTSerial); SLIPBTSerial.endPacket(); SLIPSerial.beginPacket(); - qmsg.send(SLIPSerial); + quaternionMessage.send(SLIPSerial); SLIPSerial.endPacket(); + + quaternionMessage.empty(); + + quaternionDiffMessage.add(diff.w); + quaternionDiffMessage.add(diff.x); + quaternionDiffMessage.add(diff.y); + quaternionDiffMessage.add(diff.z); + + SLIPBTSerial.beginPacket(); + quaternionDiffMessage.send(SLIPBTSerial); + SLIPBTSerial.endPacket(); + + SLIPSerial.beginPacket(); + quaternionDiffMessage.send(SLIPSerial); + SLIPSerial.endPacket(); + + quaternionDiffMessage.empty(); - qmsg.empty(); #endif