Ok, so writing the data is a bit more interesting. I just tried and something like this should work:
var data = new Uint8Array(64); // you don't have to send all 512 bytes if you don't want to
Serial1.setup(250000, {tx:B6,bytesize:8,parity:'none',stopbits:2});
// ...
function sendPacket() {
// Do the Mark after Break
digitalWrite(B6,0);
pinMode(B6, "output");
pinMode(B6, "af_output");
// Send data
Serial1.write(data);
}
setInterval(sendPacket, 100);
The timing isn't spot on, but I think it should be good enough for most DMX receivers.
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.
Ok, so writing the data is a bit more interesting. I just tried and something like this should work:
The timing isn't spot on, but I think it should be good enough for most DMX receivers.