If touchdesigner doesn't support getting data from Bluetooth, as you say you're going to have to have something inbetween to forward the data to it. You won't be able to do it direct from the Web IDE but you'll need to make a webpage that uses Web Bluetooth to get data from the Puck and then forward it to Touchdesigner.
As a start, maybe look at https://www.espruino.com/Web+Bluetooth#two-way-communications
which shows you how to use the light value from the Puck. Instead of setInterval(function(){Bluetooth.println(Puck.light());},100); for the light instead do: Puck.accelOn();Puck.on("accel", e=>Bluetooth.println(JSON.stringify(e))) to send the accel data out.
And then in function onLine(v) do something like:
try {
var obj = JSON.parse(v);
// do something with obj here to pass it to the WebSocket connection
} catch (e) {
// if something else got printed by the puck JSON.parse will fail but we just ignore it
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
If touchdesigner doesn't support getting data from Bluetooth, as you say you're going to have to have something inbetween to forward the data to it. You won't be able to do it direct from the Web IDE but you'll need to make a webpage that uses Web Bluetooth to get data from the Puck and then forward it to Touchdesigner.
As a start, maybe look at https://www.espruino.com/Web+Bluetooth#two-way-communications
which shows you how to use the light value from the Puck. Instead of
setInterval(function(){Bluetooth.println(Puck.light());},100);
for the light instead do:Puck.accelOn();Puck.on("accel", e=>Bluetooth.println(JSON.stringify(e)))
to send the accel data out.And then in
function onLine(v)
do something like:There's also something similar where a Bangle.js is used as well at https://www.espruino.com/Bangle.js+Data+Streaming - but no websockets used there either so you'd have to figure that bit out