Last edited by 97cweb at 2025-07-01 14:05:24.375341
Programming a Custom Thing
Now that you have the configs all set up, this is the easy part. Within the thing you want to make, you just need to modify the beeton.onMessage function at the top of the file.
Change the checks for if thing == to what you want your thing to be, and then check actions as needed. See the sample code for how this is done. Functions, classes, etc are all supported as this is a regular arduino sketch at this point, nothing weird.
Sending a message to your thing
To send a message, call beeton.send() with the parameters matching that of the the thing and action you want. See sample code for easy ways to get the required info.
Sending a message to the leader
Sometimes you want to send a message to the leader, especially if you are running RailCall in parallel to this. To send to the leader, call beeton.send() but put in the thing that is sending as the destination. So if you are writing code for light bulb 1 and want to send info to the leader, send a message to light bulb 1. The leader will know this is meant for it, as sending to yourself makes no sense otherwise.