<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Send accel data from M5Stack Core 2 to TouchDesigner via OSC]]></title><description><![CDATA[<p dir="auto">Hi, I'm a complete beginner with programming, and as well as, using M5Stack Core 2 and TouchDesiger.<br />
Does anyone know how to send accel data from M5Stack Core 2 to TouchDesigner via OSC?</p>
<p dir="auto">Below is the code that I copied from several sources.<br />
I could connect to the WiFi, but no response from TouchDesigner.<br />
I am not sure what's missing..<br />
Can someone teach me?</p>
<pre><code>#include &lt;M5Core2.h&gt;
#include &lt;WiFi.h&gt;
#include &lt;WiFiUdp.h&gt;
#include &lt;OSCBundle.h&gt;

const char *ssid = "***";
const char *password = "***";

const char *udpAddress ="***";
const int udpPort = 10000;

WiFiUDP udp;

float accX = 0.0F;
float accY = 0.0F;
float accZ = 0.0F;

float gyroX = 0.0F;
float gyroY = 0.0F;
float gyroZ = 0.0F;

float pitch = 0.0F;
float roll = 0.0F;
float yaw = 0.0F;

float temp = 0.0F;

uint32_t Now = 0;
uint32_t lastUpdate = 0;
float deltat = 0.0f;


void setup(){
  M5.begin();
  M5.IMU.Init();
  delay(2000);
  Serial.println("*** setup *** aaa ***");
  delay(1000);

  WiFi.begin(ssid, password);
  while(WiFi.status() != WL_CONNECTED){
    delay(500);
    M5.Lcd.print(".");
  }

  M5.Lcd.println("WiFi Connected");
  M5.Lcd.print("IP address= ");
  M5.Lcd.println(WiFi.localIP());
}

void loop(){
  M5.update();
  if(WiFi.status() == WL_CONNECTED){

    OSCBundle bndl;


    udp.beginPacket(udpAddress, udpPort);
    bndl.send(udp);
    udp.endPacket();
    bndl.empty();
  }

  delay(10);

  M5.IMU.getAccelData(&amp;accX,&amp;accY, &amp;accZ);
  M5.IMU.getTempData(&amp;temp);
  deltat = ((Now - lastUpdate)/1000000.0f);
  lastUpdate = Now;

  MahonyAHRSupdateIMU(gyroX, gyroY, gyroZ, accX, accY, accZ, &amp;pitch, &amp;roll, &amp;yaw);
  
}

</code></pre>
]]></description><link>https://community.m5stack.com/topic/5200/send-accel-data-from-m5stack-core-2-to-touchdesigner-via-osc</link><generator>RSS for Node</generator><lastBuildDate>Sun, 03 May 2026 09:05:53 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5200.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 08 Apr 2023 11:49:45 GMT</pubDate><ttl>60</ttl></channel></rss>