#define GREEN_PIN 9
#define BLUE_PIN 10
#define RED_PIN 11
void setup() {
pinMode(RED_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
pinMode(BLUE_PIN, OUTPUT);
}
void loop() {
analogWrite(RED_PIN, 255); // 빨간색
analogWrite(GREEN_PIN, 0);
analogWrite(BLUE_PIN, 0);
delay(1000);
analogWrite(RED_PIN, 0); // 초록색
analogWrite(GREEN_PIN, 255);
analogWrite(BLUE_PIN, 0);
delay(1000);
analogWrite(RED_PIN, 0); // 파랑색
analogWrite(GREEN_PIN, 0);
analogWrite(BLUE_PIN, 255);
delay(1000);
}
Copyright ⓒ TECH79 All right reserved