master
Jurij Podgoršek 2022-03-05 02:10:27 +01:00
parent 018887a13d
commit e4e7f3b867
1 changed files with 64 additions and 62 deletions

View File

@ -8,8 +8,8 @@
#include <OSCMessage.h> #include <OSCMessage.h>
//#define SERIAL_OSC //#define SERIAL_OSC
//#define WIFI_OSC #define WIFI_OSC
#define BT_OSC //#define BT_OSC
// SERIAL // SERIAL
#ifdef BOARD_HAS_USB_SERIAL #ifdef BOARD_HAS_USB_SERIAL
@ -135,7 +135,7 @@ OSCMessage kmsg("/keys/"); // A B C D E
void setup() { void setup() {
// Basic(debug) serial init // Basic(debug) serial init
// Serial.begin(115200); // set this as high as you can reliably run on your platform // Serial.begin(115200); // set this as high as you can reliably run on your platform
Serial.println("Starting up..."); Serial.println("Starting up...");
// I2C init // I2C init
@ -243,25 +243,26 @@ void loop() {
diff = q.getProduct(pq.getConjugate()); diff = q.getProduct(pq.getConjugate());
qmsg.add(q.w); qmsg.add(q.w);
qmsg.add(q.x);
qmsg.add(q.y); qmsg.add(q.y);
qmsg.add(q.x);
qmsg.add(q.z); qmsg.add(q.z);
qdmsg.add(diff.w); qdmsg.add(diff.w);
qdmsg.add(diff.x);
qdmsg.add(diff.y); qdmsg.add(diff.y);
qdmsg.add(diff.x);
qdmsg.add(diff.z); qdmsg.add(diff.z);
#ifdef SERIAL_OSC #ifdef SERIAL_OSC
SLIPSerial.beginPacket(); SLIPSerial.beginPacket();
qdmsg.send(SLIPSerial); qmsg.send(SLIPSerial);
SLIPSerial.endPacket(); SLIPSerial.endPacket();
SLIPSerial.beginPacket(); SLIPSerial.beginPacket();
qmsg.send(SLIPSerial); qdmsg.send(SLIPSerial);
SLIPSerial.endPacket(); SLIPSerial.endPacket();
#endif #endif
#ifdef WIFI_OSC #ifdef WIFI_OSC
udp.beginPacket(castIp, port); udp.beginPacket(castIp, port);
qmsg.send(udp); qmsg.send(udp);
@ -272,6 +273,7 @@ void loop() {
udp.endPacket(); udp.endPacket();
#endif #endif
// Some bug below, it seems
#ifdef BT_OSC #ifdef BT_OSC
SLIPBTSerial.beginPacket(); SLIPBTSerial.beginPacket();
qmsg.send(SLIPBTSerial); qmsg.send(SLIPBTSerial);