diff --git a/README.md b/README.md index 968b783..6d5b8c3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ # esp32-simple-test +## IDE + +### PlattformIO +A PlatformIO ```platformio.ini``` is included with the uncommented part being for an ```ESP-32D``` and the commented part for ```ESP32-C3``` + +### ArduinoIDE +You need to configure the ESP32 you are using. But keep in mind that for some the ```CDC_ON_BOOT``` may be disabled by default and needed to be renabled. + +## License +This project is licensed under the Apache License 2.0 - see the [LICENSE](./LICENSE) file for details. + +### AI +Portions of this code were generated with the assistance of ChatGPT (OpenAI GPT-5). \ No newline at end of file diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..dd46b31 --- /dev/null +++ b/platformio.ini @@ -0,0 +1,37 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +; [env:esp32-c3-devkitm-1] +; platform = espressif32 +; board = esp32-c3-devkitm-1 +; framework = arduino + +; monitor_speed = 115200 + +; build_flags = +; -DARDUINO_USB_CDC_ON_BOOT=1 +; -DARDUINO_USB_MODE=1 + +; lib_deps = +; adafruit/Adafruit SSD1306 @ ^2.5.7 +; adafruit/Adafruit GFX Library @ ^1.11.7 + +[env:esp32dev] +platform = espressif32 +board = esp32dev +framework = arduino +upload_speed = 115200 +monitor_speed = 115200 + +; Explicit flash settings for stability +board_build.flash_mode = dio +board_build.flash_size = 4MB +board_build.flash_freq = 40m + diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..7c6a610 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,21 @@ +#include + +void setup() { + // USB CDC Serial (enabled by ARDUINO_USB_CDC_ON_BOOT) + Serial.begin(115200); + + // Optional: wait until host opens the port + while (!Serial) { + delay(10); + } + + Serial.println("✅ ESP32-C3 USB CDC Serial is enabled!"); +} + +void loop() { + static uint32_t counter = 0; + + Serial.print("Loop counter: "); + Serial.println(counter++); + delay(1000); +} \ No newline at end of file