본문 바로가기
AI 코딩

PlatformIO 설치 및 활용 : 초보자 가이드

by 피크나인 2025. 6. 30.

홈  /  개발환경구축  /  ESP32  /  PlatformIO 설치 및 활용 : 초보자 가이드

 

[ESP32] PlatformIO로 ESP32-S3 개발하기 -  초보자도 쉽게 따라할 수 있는 완벽 가이드

 

ESP32-S3 개발을 시작하려다가 Arduino IDE의 한계에 답답함을 느끼고 계신가요? 저도 처음엔 Arduino IDE로 시작했지만, 프로젝트 규모가 커지고 라이브러리 관리가 복잡해지면서 PlatformIO로 갈아탔습니다. 이제는 Arduino IDE로 돌아갈 수 없을 정도로 편리함을 느끼고 있어요. 물론 당연히 Arduino IDE는 AI Copilot의 도움을 받기도 힘들지만, VSCODE의 확장으로 설치하는 PlatformIO 플랫폼은VSCODE에서 사용할 수 있는 Github Copilot, Google Gemini등의 인공지능의 힘을 빌릴 수 도 있죠.                  

이 글에서는 macOS 환경에서 PlatformIO를 설치하고 ESP32-S3 개발 환경을 구축하는 과정을 실제 경험을 바탕으로 상세히 설명하겠습니다.

왜 PlatformIO를 선택했을까?

Arduino IDE를 사용하다 보면 이런 불편함들을 느끼게 됩니다:

  • 라이브러리 버전 관리가 어렵다
  • 여러 프로젝트에서 같은 라이브러리의 다른 버전이 필요할 때 충돌이 발생한다
  • 자동완성과 디버깅 기능이 부족하다
  • 프로젝트 구조가 체계적이지 않다

PlatformIO는 이런 문제들을 깔끔하게 해결해줍니다. 특히 ESP32-S3처럼 다양한 기능을 활용해야 하는 경우, 라이브러리 의존성 관리가 매우 중요한데 PlatformIO가 이를 자동으로 처리해주죠.

1. PlatformIO 설치하기

준비물 확인

먼저 macOS에 Python이 설치되어 있는지 확인해보세요. 터미널에서 다음 명령어를 실행합니다:

python3 --version

Python이 없다면 공식 홈페이지에서 다운로드하거나 Homebrew로 설치할 수 있습니다:

brew install python3

PlatformIO 설치

개인적으로 pip를 이용한 설치를 추천합니다. 설치 과정이 투명하고 문제가 생겼을 때 해결하기 쉽거든요:

python3 -m pip install --upgrade pip
python3 -m pip install --upgrade platformio

PlatformIO 플랫폼은 터미널에서 설치하기 보다는 VSCODE  확장 프로그램으로 설치하는게 많이 편리하긴 합니다.   아래의 2.VS Code와 PlatformIO 연동하기를 참조하세요.             

설치가 완료되면 다음 명령어로 확인해보세요:

pio --version

: 저는 처음에 Homebrew로 설치했다가 나중에 pip로 재설치했습니다. pip가 더 안정적이고 업데이트도 쉬워요.

2. VS Code와 PlatformIO 연동하기

여러 IDE를 써봤지만 VS Code + PlatformIO Extension 조합이 최고입니다. 무료이면서도 기능이 강력하거든요.

  1. VS Code 공식 사이트에서 다운로드
  2. VS Code에서 Extensions (⌘+⇧+X) → "PlatformIO IDE" 검색 → 설치
  3. VS Code 재시작

설치 후 왼쪽 사이드바에 PlatformIO 아이콘(개미모양 아이콘)  이 나타나면 성공입니다. PlatformIO 아이콘을 선택하면 PlatformIO와 관련된 다양한 기능을사용 할 수 있고 처음 접근하는 초보자라면 PIO Home > Open을 선택해서 홈 화면으로 이동 하시는걸 추천합니다.                   

Visual Studio Code 확장으로 PlatformIO를 설치한 후 프로젝트를 생성 및 연동 화면
Visual Studio Code 확장으로 PlatformIO를 설치한 후 프로젝트를 생성 및 연동 화면

3. 첫 번째 ESP32-S3 프로젝트 만들기

프로젝트 생성

VS Code에서 PlatformIO 아이콘을 클릭하고 "PlatformIO Home"을 선택합니다. 처음 열면 약간 로딩 시간이 있는데, 내부적으로 필요한 도구들을 다운로드하고 있으니 기다려주세요.(PlatformIO와 관련된 다양한 라이브러리  및 툴을 설치하는 시간이 약간의 기다림은 필수입니다. PlatformIO와 관련된 설치 및 진행상황과 관련된 로그는 우측 하단의 토스트 팝업으로 나타나니까 주의 깊게 살펴보시면 됩니다.)                           

PlatformIO > HOME > NewProject 선택시 신규 프로젝트 생성 화면
PlatformIO > HOME > NewProject 선택시 신규 프로젝트 생성 화면

 

"New Project" 버튼을 클릭하고 다음과 같이 설정합니다:

  • Project Name: my_first_esp32s3 (프로젝트 이름, 프로젝트 이름은 폴더명과 일치하는게 헷갈리지 않고 좋아요.       )
  • Board: ESP32-S3-DevKitC-1 선택 (ESP32-S3-WROOM-1 이든 뭐든 기본적으로 ESP32-S3인 경우는 라이브러리 및 핀매핑이 많이 다르지 않아요. 보드선택에 스트레스를 받지 마시고기본적으로 ESP32-DevKitC-1을 선택하면 바로 프로젝트를 시작할 수 있어요.)                  
  • Framework: Arduino 선택 (ESP-IDF도 좋지만 초보자에게는 Arduino가 편해요. 왠만한 중급자 이상의 임베디드 개발자가 아닌 이상 Arduino를 선택하는게 정신 건강에 좋아요.  ESP-IDF는 하드웨어 구조 및 라이브러리에 대해 많은 지식이 필요해요. 물론 상세한 부분까지 제어를 하고 커스텀으로 조정할게 많다면 ESP-IDF가 유리합니다. )
  • Location: 기본값 사용 또는 원하는 폴더 선택 (프로젝트 폴더를 미리 만들어 두었다 지정하면 편리해요)       

주의: 보드 선택 시 자신의 ESP32-S3 보드와 정확히 맞는 모델을 선택해야 합니다. 잘못 선택하면 나중에 핀 매핑이나 기능에서 문제가 생길 수 있어요.

프로젝트 구조 이해하기

생성된 프로젝트를 보면 다음과 같은 구조를 갖습니다:

my_first_esp32s3/
├── src/
│   └── main.cpp
├── lib/
├── test/
├── include/
└── platformio.ini

Arduino IDE와 달리 코드 파일들이 체계적으로 정리되어 있죠. 특히 platformio.ini 파일이 핵심인데, 이 파일에서 모든 설정을 관리합니다.(platformio.ini의 lib_deps에 의해 설치되는 라이브러리는 ".pio/lib_deps"에 설치됩니다.)        

4. platformio.ini 설정 마스터하기

이 파일은 PlatformIO의 심장이라고 할 수 있습니다. 처음 생성하면 기본 설정만 들어있는데, 실제 개발에서는 많은 설정을 추가해야 해요.

기본 설정

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino

; 시리얼 통신 속도 - 디버깅할 때 매우 중요해요
monitor_speed = 115200

; 업로드 속도 - 느리면 이 값을 줄여보세요
upload_speed = 921600

; PSRAM 사용 설정 - ESP32-S3의 장점을 살리려면 필수
board_build.arduino.memory_type = qio_opi
build_flags = 
    -DBOARD_HAS_PSRAM
    -DCORE_DEBUG_LEVEL=0

실전 팁

제가 실제 프로젝트에서 사용하는 설정들입니다.조금복잡해보이지만 기본을 설정하고, Windows / MacOS 개발 환경에 따라 기본 설정을 상속받고, 디버깅 할 때마다 하나 둘씩 추가하니까 조금 많아졌네요. 초보자인 경우는 기본 설정만으로도 충분히 프로젝트를 진행하실 수 있습니다. 프로젝트 진행하면서 하나 둘씩 추가하는 걸 추천 합니다.                    

; ESP32 Matrix Portal S3 - PlatformIO Project Configuration
; --------------------------------------------------------------------
;
; @file platformio.ini
; @brief Production-ready PlatformIO configuration for ESP32 Matrix Portal S3
; 
; @doc This configuration file defines the build environment for the ESP32 
; Matrix Portal S3 LED matrix display project. It includes optimized settings
; for both development and production builds across different platforms.
;
; Key Features:
; - ESP32-S3 with PSRAM support for large displays
; - Optimized compiler flags for performance and stability
; - Cross-platform compatibility (Windows/macOS)
; - Advanced warning suppression for clean builds
; - Memory optimization for LED matrix operations
; - Integrated debugging and monitoring tools
;
; Hardware Target: Adafruit Matrix Portal ESP32-S3
; Display: 64x64 RGB LED Matrix Panel
; Memory: ESP32-S3 with PSRAM enabled
; Flash: LittleFS filesystem for configuration storage
;
; @version 1.0
; @date 2025-01-12
; @author Denny Kim, Feature Lead : ESP32 Matrix Portal S3 Team
; --------------------------------------------------------------------

[platformio]
; Default build environment - optimized for macOS development
default_envs = matrixportal_s3_mac

; Project description displayed in PlatformIO IDE
description = Adafruit Matrix Portal S3 with 64x64 LED Matrix

; SHARED ENVIRONMENT CONFIGURATION
; --------------------------------------------------------------------

[common_env_settings]
; Hardware platform configuration
platform = espressif32              ; ESP32 platform with Arduino framework support
board = adafruit_matrixportal_esp32s3 ; Adafruit Matrix Portal ESP32-S3 board definition
framework = arduino                  ; Arduino framework for familiar development environment

; Partition and filesystem configuration
board_build.partitions = default.csv ; ESP32 partition table for app/OTA/SPIFFS/NVS
board_build.filesystem = littlefs   ; LittleFS for reliable file operations and wear leveling

; Static analysis and code quality tools
check_tool = cppcheck, clangtidy     ; Enable both static analysis tools
check_flags = 
	cppcheck: --enable=all --std=c++17  ; Full C++17 analysis with all checks enabled
	clangtidy: --checks=*                ; Enable all available clang-tidy checks

; LIBRARY DEPENDENCIES
; --------------------------------------------------------------------
; @doc Carefully selected library versions for stability and compatibility
; All versions are pinned to ensure reproducible builds across environments
; - Core libraries for LED MATRIX is 'ESP32-HUB75_MatrixPanel-DMA' in /lib which is 
;   included in the Adafruit Matrix Portal S3 board definition
; - LittleFS filesystem is used for configuration storage and is built-in with ESP32 platform
; - Network libraries for MQTT and JSON are 'PubSubClient' and 'ArduinoJson'
; - Sensor libraries for accelerometer support are 'Adafruit LIS3DH' and 'Adafruit Unified Sensor'
; - IR commands library is 'Yahboom_IR' in /lib which is included customed 'NEC' protocols

lib_deps = 
    bblanchon/ArduinoJson@6.21.3            ; JSON parsing/generation for MQTT and config
    knolleary/PubSubClient@2.8              ; MQTT client library for IoT communication
    adafruit/Adafruit GFX Library@^1.11.9   ; Core graphics library for display operations
    adafruit/Adafruit BusIO@1.14.1          ; I2C/SPI communication abstraction layer
    fastled/FastLED@^3.9.0                  ; High-performance LED control library
    adafruit/Adafruit LIS3DH@1.2.4          ; 3-axis accelerometer support (if available)
    adafruit/Adafruit Unified Sensor@1.1.9  ; Unified sensor driver interface
    bitbank2/AnimatedGIF @ ^2.2.0           ; Optimized GIF animation and image decoder
    bitbank2/PNGdec @ ^1.1.3                ; Efficient PNG image decoder

; COMPILER AND BUILD CONFIGURATION
; --------------------------------------------------------------------
; @doc Production-optimized build flags for performance, stability, and compatibility

build_flags = 
    ; Warning control for clean builds
    -Wno-sign-compare                    ; Suppress signed/unsigned comparison warnings
    -Wno-unknown-pragmas                 ; Suppress unknown pragma warnings from FastLED
    
    ; Network and connectivity configuration
    -DWIFI_RSSI_THRESHOLD=-70            ; WiFi signal strength threshold for connection
    
    ; Debugging and logging configuration
    -DCORE_DEBUG_LEVEL=4                 ; ESP32 core debug level (0=None, 5=Verbose)
    
    ; Memory management - ESP32-S3 PSRAM optimization
    -DBOARD_HAS_PSRAM                    ; Enable PSRAM support for large displays
    -DCONFIG_SPIRAM_SUPPORT=1            ; Enable external SPI RAM support
    -DCONFIG_SPIRAM_USE_MALLOC=1         ; Use PSRAM for malloc operations
    -DCONFIG_SPIRAM_USE_CAPS_ALLOC=1     ; Enable capability-aware memory allocation
    
    ; LED library optimization
    -DFASTLED_ESP32_USE_RMT=1            ; Use ESP32 RMT peripheral for precise timing
    
    ; Media library debugging
    -DANIMATEDGIF_DEBUG=1                ; Enable AnimatedGIF library debug output
    
    ; Additional optimization notes:
    ; - PSRAM settings enable large frame buffers for 64x64+ displays
    ; - RMT usage ensures precise LED timing without interference
    ; - Debug levels can be reduced to 0-2 for production builds

; BUILD AUTOMATION AND TOOLING
; --------------------------------------------------------------------

; Pre-build script to update version information automatically
extra_scripts = pre:tools/update_version.py

; UPLOAD AND FLASHING CONFIGURATION
; --------------------------------------------------------------------
; @doc Optimized settings for reliable ESP32-S3 firmware uploads

; Upload configuration for ESP32-S3
upload_flags = 
    --chip esp32s3                       ; Specify ESP32-S3 chip explicitly
    --before = nodemcu                   ; Reset method before flashing (compatible mode)
    --after = hard_reset                 ; Hard reset after flashing for clean boot

; Upload speed - balance between speed and reliability
upload_speed = 460800                    ; 460.8 kbps - optimal for most USB connections

; SERIAL MONITORING CONFIGURATION
; --------------------------------------------------------------------
; @doc Development and debugging settings for serial communication

monitor_speed = 115200                   ; Standard baud rate for serial communication
monitor_filters = esp32_exception_decoder ; Automatic stack trace decoding for debugging
monitor_rts = 0                          ; Disable RTS flow control
monitor_dtr = 0                          ; Disable DTR flow control

; ENVIRONMENT DEFINITIONS
; --------------------------------------------------------------------

; Windows Development Environment
; --------------------------------------------------------------------
; @doc Optimized build environment for Windows development systems
; Inherits all common settings with Windows-specific optimizations

[env:matrixportal_s3_win]
platform = ${common_env_settings.platform}
board = ${common_env_settings.board}
framework = ${common_env_settings.framework}
monitor_speed = ${common_env_settings.monitor_speed}
board_build.partitions = ${common_env_settings.board_build.partitions}
board_build.filesystem = ${common_env_settings.board_build.filesystem}
lib_deps = ${common_env_settings.lib_deps}
build_flags = ${common_env_settings.build_flags}

; Windows-specific notes:
; - Ensure COM port drivers are installed for ESP32-S3
; - Windows Defender may interfere with upload process
; - Use Device Manager to verify correct COM port assignment

; macOS Development Environment  
; --------------------------------------------------------------------
; @doc Optimized build environment for macOS development systems
; Includes additional upload speed optimization for macOS systems

[env:matrixportal_s3_mac]
platform = ${common_env_settings.platform}
board = ${common_env_settings.board}
framework = ${common_env_settings.framework}
board_build.partitions = ${common_env_settings.board_build.partitions}
board_build.filesystem = ${common_env_settings.board_build.filesystem}
lib_deps = ${common_env_settings.lib_deps}
build_flags = ${common_env_settings.build_flags}
monitor_speed = ${common_env_settings.monitor_speed}
upload_speed = ${common_env_settings.upload_speed}

; macOS-specific notes:
; - USB-C to USB-A adapters may affect upload reliability
; - Terminal.app or iTerm2 recommended for serial monitoring
; - Xcode command line tools required for optimal compilation
; - Consider using higher upload speeds (921600) if connection is stable

; PRODUCTION BUILD RECOMMENDATIONS
; --------------------------------------------------------------------
; 
; For production deployments, consider these modifications:
; 
; 1. Reduce debug output:
;    -DCORE_DEBUG_LEVEL=0 or -DCORE_DEBUG_LEVEL=1
; 
; 2. Disable library debugging:
;    Remove -DANIMATEDGIF_DEBUG=1
; 
; 3. Enable compiler optimizations:
;    Add -O2 or -Os for size optimization
; 
; 4. Consider watchdog timer:
;    Add -DCONFIG_ESP_TASK_WDT_TIMEOUT_S=10
; 
; 5. Optimize partition table:
;    Use custom partition table for specific memory requirements
; 
; Example production build_flags:
; build_flags = 
;     -Os                              ; Size optimization
;     -DCORE_DEBUG_LEVEL=1             ; Minimal debug output
;     -DBOARD_HAS_PSRAM
;     -DCONFIG_SPIRAM_SUPPORT=1
;     -DCONFIG_SPIRAM_USE_MALLOC=1
;     -DCONFIG_SPIRAM_USE_CAPS_ALLOC=1
;     -DFASTLED_ESP32_USE_RMT=1
;     -DCONFIG_ESP_TASK_WDT_TIMEOUT_S=10
; --------------------------------------------------------------------------------

5. 첫 번째 코드 작성하기

LED 깜빡임 예제

src/main.cpp 파일을 열고 다음 코드를 작성해보세요:

#include <Arduino.h>

// ESP32-S3 DevKit의 RGB LED 핀 (보드마다 다를 수 있음)
#define LED_PIN 48

void setup() {
    Serial.begin(115200);
    
    // USB Serial이 연결될 때까지 대기 (디버깅에 유용)
    while (!Serial && millis() < 5000) {
        delay(100);
    }
    
    pinMode(LED_PIN, OUTPUT);
    Serial.println("ESP32-S3 개발 시작!");
}

void loop() {
    digitalWrite(LED_PIN, HIGH);
    Serial.println("LED 켜짐");
    delay(1000);
    
    digitalWrite(LED_PIN, LOW);
    Serial.println("LED 꺼짐");
    delay(1000);
}

실제 경험: 처음에 LED가 안 켜져서 당황했는데, 보드마다 LED 핀 번호가 다르더라고요. 자신의 보드 스키매틱을 확인해보세요.

WiFi 연결 예제

ESP32-S3의 진정한 힘은 WiFi 연결에서 나타납니다:

#include <Arduino.h>
#include <WiFi.h>

const char* ssid = "당신의_WiFi_이름";
const char* password = "당신의_WiFi_비밀번호";

void setup() {
    Serial.begin(115200);
    delay(1000);
    
    Serial.println("WiFi 연결 시도 중...");
    WiFi.begin(ssid, password);
    
    int attempts = 0;
    while (WiFi.status() != WL_CONNECTED && attempts < 20) {
        delay(500);
        Serial.print(".");
        attempts++;
    }
    
    if (WiFi.status() == WL_CONNECTED) {
        Serial.println();
        Serial.println("WiFi 연결 성공!");
        Serial.print("IP 주소: ");
        Serial.println(WiFi.localIP());
        Serial.print("신호 강도: ");
        Serial.println(WiFi.RSSI());
    } else {
        Serial.println();
        Serial.println("WiFi 연결 실패!");
    }
}

void loop() {
    if (WiFi.status() == WL_CONNECTED) {
        Serial.println("WiFi 연결 상태: 정상");
    } else {
        Serial.println("WiFi 연결 끊어짐 - 재연결 시도");
        WiFi.reconnect();
    }
    delay(10000);
}

6. 빌드하고 업로드하기

VS Code에서 빌드하기

VS Code 하단의 상태바를 보면 PlatformIO 아이콘들이 보입니다:

  • ✓ 아이콘: 빌드 (단축키: ⌘+⌥+B)
  • → 아이콘: 업로드 (단축키: ⌘+⌥+U)
  • 🔌 아이콘: 시리얼 모니터

프로그램 빌드(컴파일)가 정상적으로 완료된 경우 (&quot;./ProjectFolder/pio run&quot;)
프로그램 빌드(컴파일)가 정상적으로 완료된 경우 ("./ProjectFolder/pio run")

명령어로 빌드하기

터미널을 선호한다면 다음 명령어들을 사용하세요:

# 프로젝트 디렉토리로 이동
cd my_project

# 이전 빌드 및 컴파일 에러시 빌드 캐시 초기화
pio run -t clean

# 빌드만 하기
pio run

# 빌드하고 업로드
pio run -t upload

# 시리얼 모니터 실행
pio device monitor

# 한 번에 모든 것 실행
pio run -t upload && pio device monitor

7. ESP32-S3만의 특별한 기능들

PSRAM 활용하기

ESP32-S3의 가장 큰 장점 중 하나는 PSRAM입니다. 큰 배열이나 이미지 데이터를 다룰 때 매우 유용해요:

#include <Arduino.h>

void setup() {
    Serial.begin(115200);
    
    // PSRAM 사용 가능 여부 확인
    if (psramFound()) {
        Serial.println("PSRAM 사용 가능!");
        Serial.printf("PSRAM 크기: %d bytes\n", ESP.getPsramSize());
        Serial.printf("사용 가능한 PSRAM: %d bytes\n", ESP.getFreePsram());
    } else {
        Serial.println("PSRAM을 찾을 수 없습니다.");
    }
    
    // 큰 배열을 PSRAM에 할당
    uint8_t* largeArray = (uint8_t*)ps_malloc(1024 * 1024); // 1MB
    if (largeArray != NULL) {
        Serial.println("1MB 배열 할당 성공!");
        free(largeArray);
    }
}

void loop() {
    delay(1000);
}

멀티코어 활용하기

ESP32-S3는 듀얼코어 프로세서입니다. 무거운 작업을 별도 코어에서 실행할 수 있어요:

#include <Arduino.h>

void heavyTask(void *parameter) {
    while (true) {
        // 무거운 계산 작업
        for (int i = 0; i < 1000000; i++) {
            // 복잡한 계산
        }
        Serial.printf("Heavy task 완료 - Core: %d\n", xPortGetCoreID());
        delay(2000);
    }
}

void setup() {
    Serial.begin(115200);
    
    // Core 0에서 무거운 작업 실행
    xTaskCreatePinnedToCore(
        heavyTask,      // 함수 포인터
        "HeavyTask",    // 태스크 이름
        10000,          // 스택 크기
        NULL,           // 매개변수
        1,              // 우선순위
        NULL,           // 태스크 핸들
        0               // 코어 번호 (0 또는 1)
    );
    
    Serial.println("메인 태스크는 Core 1에서 실행됩니다.");
}

void loop() {
    Serial.printf("Main loop - Core: %d\n", xPortGetCoreID());
    delay(1000);
}

8. 자주 마주치는 문제들과 해결법

업로드가 안 될 때

이 문제로 정말 많이 고생했어요. 해결 방법들을 시도해보세요:

  1. BOOT 버튼 활용: BOOT 버튼을 누른 상태에서 업로드 시작
  2. 케이블 확인: 충전 전용 케이블이 아닌 데이터 케이블 사용
  3. 포트 권한 설정:
    sudo chmod 666 /dev/cu.usbmodem*
    
  4. 업로드 속도 조정: platformio.ini에서 upload_speed = 460800으로 낮추기

시리얼 모니터가 안 보일 때

# 연결된 시리얼 포트 확인
ls /dev/cu.*

# 특정 포트로 모니터 실행
pio device monitor --port /dev/cu.usbmodem14101

라이브러리 충돌 문제

# 라이브러리 캐시 삭제
pio lib uninstall --global

# 프로젝트 클린
pio run -t clean

9. 실전 라이브러리 관리

검색하고 설치하기

# 라이브러리 검색
pio lib search "json"

# 설치
pio lib install "ArduinoJson"

# 특정 버전 설치
pio lib install "ArduinoJson@6.21.3"

프로젝트별 라이브러리 관리

platformio.ini에서 관리하는 것이 가장 좋습니다:

lib_deps = 
    ; JSON 처리
    bblanchon/ArduinoJson@^6.21.3
    
    ; 웹 서버
    me-no-dev/ESPAsyncWebServer@^1.2.3
    me-no-dev/AsyncTCP@^1.1.1
    
    ; 센서 라이브러리
    adafruit/Adafruit BME280 Library@^2.2.2
    
    ; GitHub에서 직접 설치
    https://github.com/me-no-dev/AsyncTCP.git#v1.1.1

10. 프로젝트 구조 최적화

큰 프로젝트를 진행할 때는 코드 구조가 중요합니다:

src/
├── main.cpp
├── config.h
├── wifi/
│   ├── wifi_manager.cpp
│   └── wifi_manager.h
├── sensors/
│   ├── bme280_sensor.cpp
│   └── bme280_sensor.h
└── web/
    ├── web_server.cpp
    └── web_server.h

헤더 파일 예시 (config.h)

#ifndef CONFIG_H
#define CONFIG_H

// WiFi 설정
#define WIFI_SSID "YourWiFiName"
#define WIFI_PASSWORD "YourWiFiPassword"

// 핀 정의
#define LED_PIN 48
#define BUTTON_PIN 0

// 기타 설정
#define SERIAL_BAUD_RATE 115200
#define LOOP_DELAY 1000

#endif

마무리하며

PlatformIO로 ESP32-S3 개발 환경을 구축하는 과정을 실제 경험을 바탕으로 설명해드렸습니다. 처음에는 Arduino IDE에 비해 복잡해 보일 수 있지만, 한 번 익숙해지면 그 편리함을 절대 포기할 수 없을 거예요.

특히 ESP32-S3처럼 강력한 마이크로컨트롤러를 다룰 때는 PlatformIO의 프로젝트 관리 기능이 정말 빛을 발합니다. 라이브러리 버전 관리, 빌드 설정, 디버깅 등 모든 면에서 Arduino IDE보다 한 차원 높은 개발 경험을 제공하거든요.

혹시 설정 과정에서 막히는 부분이 있다면 PlatformIO 공식 문서를 참고하시거나, 커뮤니티 포럼에서 도움을 요청해보세요. ESP32-S3 관련해서는 Espressif 공식 문서도 매우 유용합니다.

이제 여러분도 PlatformIO와 ESP32-S3로 멋진 IoT 프로젝트를 시작해보세요!