LED 센서 모듈, ESP32 확장 보드, 브레드보드(빵판)을 사용하여 테스트를 진행했다.
| LED 센서 모듈 | ESP32 확장 보드 |
| G | D16 |
| R | D4 |
| B | D2 |
| I | GRD |


#define RED_PIN 4
#define GREEN_PIN 16
#define BLUE_PIN 2
void setup() {
pinMode(RED_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
pinMode(BLUE_PIN, OUTPUT);
digitalWrite(RED_PIN, HIGH);
digitalWrite(GREEN_PIN, HIGH);
digitalWrite(BLUE_PIN, HIGH);
}
void loop() {
// 빨강
analogWrite(RED_PIN, 0);
analogWrite(GREEN_PIN, 255);
analogWrite(BLUE_PIN, 255);
delay(1000);
// 초록
analogWrite(RED_PIN, 255);
analogWrite(GREEN_PIN, 0);
analogWrite(BLUE_PIN, 255);
delay(1000);
// 파랑
analogWrite(RED_PIN, 255);
analogWrite(GREEN_PIN, 255);
analogWrite(BLUE_PIN, 0);
delay(1000);
analogWrite(RED_PIN, 255);
analogWrite(GREEN_PIN, 255);
analogWrite(BLUE_PIN, 255);
delay(1000);
}

(옆에 껀 온습도 센서인데 해당 포스팅에선 사용 안하므로 무시하면 된다)
참고 레퍼런스
ESP32로 만드는 IoT 월드 with 아두이노 IDE 2
'Arduino > Windows' 카테고리의 다른 글
| [Arduino | Windows] 릴레이 모듈 테스트 (0) | 2025.05.05 |
|---|---|
| [Arduino | Windows] 온습도 센서 모듈 테스트 (0) | 2025.05.05 |
| [Arduino | Windows] LED 작동 테스트 (0) | 2025.05.03 |
| [Arduino | Windows] Arduino IDE ESP32 연결하기 (1) | 2025.05.03 |