I'm actually doing something at the moment with one to many via UART... Data rate isn't a big deal, so actually I'm using the console. Each slave has:
var ID = 1234;
function onInit() {
Serial1.setup(9600, { tx:B6, rx:B7 });
pinMode(B6, "af_opendrain");
Serial1.setConsole();
echo(0);
}
and when I want to send data from the master I do:
Serial1.println("myFunction()\n"); // global
Serial1.println("if(ID==1234)myFunction()\n"); // just one
Understandably that isn't ideal in all cases though. Thing is, with I2C it's basically just sending a byte first, which is the address. It shouldn't be too hard to do that with the UART too, I guess the only thing you'd really want to do is to have a good way of determining what the start of frame was.
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.
I'm actually doing something at the moment with one to many via UART... Data rate isn't a big deal, so actually I'm using the console. Each slave has:
and when I want to send data from the master I do:
Understandably that isn't ideal in all cases though. Thing is, with I2C it's basically just sending a byte first, which is the address. It shouldn't be too hard to do that with the UART too, I guess the only thing you'd really want to do is to have a good way of determining what the start of frame was.