• 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#t­wo-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
    }
    

    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

About

Avatar for Gordon @Gordon started