#include <Adafruit_NeoPixel.h>
#define PIN 6 #define NUMPIXELS 4
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() { pixels.begin(); pixels.setBrightness(50); // 밝기 설정 (0-255) }
void loop() { // 1, 2번 LED 빨강, 3, 4번 LED 꺼짐 pixels.setPixelColor(0, pixels.Color(255, 0, 0)); pixels.setPixelColor(1, pixels.Color(255, 0, 0)); pixels.setPixelColor(2, pixels.Color(0, 0, 0)); pixels.setPixelColor(3, pixels.Color(0, 0, 0)); pixels.show(); delay(250); // 0.25초 대기
// 1, 2번 LED 꺼짐, 3, 4번 LED 파랑 pixels.setPixelColor(0, pixels.Color(0, 0, 0)); pixels.setPixelColor(1, pixels.Color(0, 0, 0)); pixels.setPixelColor(2, pixels.Color(0, 0, 255)); pixels.setPixelColor(3, pixels.Color(0, 0, 255)); pixels.show(); delay(250); // 0.25초 대기 }