This code is designed for at least one Argon and as many Xenons as you want. There is only one piece of code and it compiles on both platforms without any changes. Here is a link:
First, flash the Argon and enable your favorite flavor of serial monitor. The Argon will perform a mesh subscribe to “random_num”. As each Xenon is brought online, it will publish to
"random_num/<device name>/X, where X is a random number between 30 and 64. I used random numbers to make it easy for those without any specific sensors.
There is about a second delay between each publish, so it works out the whole system pretty well.
One thing I wasn’t sure about yet (and I need to research), is whether or not to enable threading on either the Argon or Xenons. If anyone has any particular thoughts on that topic I would like to hear them.
One other question on “delay”…will it eventually cause a problem in mesh communications? Is it better to use millis-based delays instead so you can still use