diff --git a/platformio.ini b/platformio.ini index 02ed9c3..08e5827 100644 --- a/platformio.ini +++ b/platformio.ini @@ -15,4 +15,8 @@ framework = arduino monitor_speed = 115200 upload_port = /dev/cu.SLAB_USBtoUART debug_tool = esp-prog -debug_init_break = tbreak setup \ No newline at end of file +debug_init_break = tbreak setup +; I am using src_filter as a cheap way to have multiple main files in one project. +; To use it all you have to do is add the target main file like here we add main3.cpp as out build target: +; src_filter =+<*> - + +src_filter =+<*> - + \ No newline at end of file diff --git a/src/main2.cpp b/src/main2.cpp new file mode 100644 index 0000000..c8db78f --- /dev/null +++ b/src/main2.cpp @@ -0,0 +1,24 @@ +#include +#include + +#define LED_BUILTIN 2 +int delayTime = 100; + +void setup() +{ + // put your setup code here, to run once: + pinMode(LED_BUILTIN, OUTPUT); + Serial.begin(115200); +} + +void loop() +{ + // put your main code here, to run repeatedly: + Serial.println("Starting loop"); + digitalWrite(LED_BUILTIN, HIGH); + delay(delayTime); + digitalWrite(LED_BUILTIN, LOW); + Serial.println("Turning off LED"); + printf("This is main2.cpp!\n"); + delay(delayTime); +} \ No newline at end of file diff --git a/src/main3.cpp b/src/main3.cpp new file mode 100644 index 0000000..a724ff8 --- /dev/null +++ b/src/main3.cpp @@ -0,0 +1,24 @@ +#include +#include + +#define LED_BUILTIN 2 +int delayTime = 1000; + +void setup() +{ + // put your setup code here, to run once: + pinMode(LED_BUILTIN, OUTPUT); + Serial.begin(115200); +} + +void loop() +{ + // put your main code here, to run repeatedly: + Serial.println("Starting loop"); + digitalWrite(LED_BUILTIN, HIGH); + delay(delayTime); + digitalWrite(LED_BUILTIN, LOW); + Serial.println("Turning off LED"); + printf("This is main3.cpp!\n"); + delay(delayTime); +} \ No newline at end of file