Running two programs by toggle switch

09 Sep 2017

There are two programs I would like to run on an LPC1768 board. The idea is to switch between the two programs using a toggle switch. I understand both programs need to be compiled into one binary somehow.

This is the first program https://developer.mbed.org/users/Just4pLeisure/code/Just4Trionic/

And this is the second program https://developer.mbed.org/users/petter/code/Saab-BT/

Not sure how you do this. I know each program has a main.cpp and I'm not sure how to change the programs so that they could be called from a new main.cpp program based on the state of a SPST toggle switch.