From 42f3753b2b7993d8dd224c45c5e782e7877c59ca Mon Sep 17 00:00:00 2001 From: Thomas Wilson Date: Wed, 13 Apr 2022 09:11:16 +0800 Subject: [PATCH] Split source into the two ESP32 modules --- platformio.ini | 10 ++++++++-- src/main.cpp | 15 --------------- src/motor-esp32/main.cpp | 15 +++++++++++++++ src/primary-esp32/main.cpp | 13 +++++++++++++ 4 files changed, 36 insertions(+), 17 deletions(-) delete mode 100644 src/main.cpp create mode 100644 src/motor-esp32/main.cpp create mode 100644 src/primary-esp32/main.cpp diff --git a/platformio.ini b/platformio.ini index e598ec7..293a3f2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,8 +9,14 @@ ; https://docs.platformio.org/page/projectconf.html -[env:default] +[env] platform = espressif32 framework = arduino board = esp32dev -monitor_speed = 57600 \ No newline at end of file +monitor_speed = 57600 + +[env:motor-esp32] +src_filter = + + +[env:primary-esp32] +src_filter = + \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index 9306eff..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include - -#define MOTOR_SPEED_SENSE 5 - -void setup() { - pinMode(MOTOR_SPEED_SENSE, INPUT_PULLUP); - - Serial.setTimeout(1); - Serial.begin(57600); -} - -void loop() { - delay(10); - Serial.println(digitalRead(MOTOR_SPEED_SENSE)); -} \ No newline at end of file diff --git a/src/motor-esp32/main.cpp b/src/motor-esp32/main.cpp new file mode 100644 index 0000000..33a9977 --- /dev/null +++ b/src/motor-esp32/main.cpp @@ -0,0 +1,15 @@ +#include + +#define MOTOR_SPEED_SENSE 5 + +void setup() { + pinMode(MOTOR_SPEED_SENSE, INPUT_PULLUP); + + Serial.setTimeout(1); + Serial.begin(57600); +} + +void loop() { + delay(10); + Serial.println(digitalRead(MOTOR_SPEED_SENSE)); +} \ No newline at end of file diff --git a/src/primary-esp32/main.cpp b/src/primary-esp32/main.cpp new file mode 100644 index 0000000..c6eb01c --- /dev/null +++ b/src/primary-esp32/main.cpp @@ -0,0 +1,13 @@ +#include + +#define MOTOR_SPEED_SENSE 5 + +void setup() { + Serial.setTimeout(1); + Serial.begin(57600); +} + +void loop() { + delay(1000); + Serial.println("PrimaryESP32"); +} \ No newline at end of file