Hi I have 4 separate programs running on there own, I would like to combine the code to run at the same time on a Boron… just need some advice on how to do it… i seen the plus sign on the Web IDE would that be useful. the programs are the following GPS, Voltage sensor (MCP3428), temperature probe and hall sensor (door contractor) that triggers a relay. deploying this on a solar trailer for temp power on a 5G network node… any help would be appreciated.
@bbarr7iot, welcome to the Community! When you say you have four separate programs running on their own, I assume you have a .ino file for each along with their associated libraries. Your new “program” (.ino) file will contain, in the least, a
setup() and a
loop() function containing your code.
In order to combine the “programs”, you will need to merge the code of your programs into a single .ino file. This means combining the code in the
setup() functions into a single
setup() function, doing the same for the code and logic (program flow) of the code in the
loop() functions for the new single
loop() function. You will also need to include any code outside of
loop() functions, typically added at the top of each “program” prior to the
setup() function code.
As for the libraries, you can either attach libraries available in the Web IDE to your program or add tabs in the Web IDE for each of the library .cpp and .h files you need to add. Ideally, you can find your libraries in the Web IDE and simply attach them.
Thanks for the response.