#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NUMPIXELS 4
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin();
pixels.clear();
pixels.show();
}
void loop() {
*// 초록색 신호 (5초)*
pixels.setPixelColor(0, pixels.Color(0, 255, 0));
pixels.show();
delay(5000);
pixels.clear();
*// 노란색 신호 (빠르게 5번 깜빡임)*
for (int i = 0; i < 5; i++) {
pixels.setPixelColor(1, pixels.Color(255, 255, 0));
pixels.show();
delay(500);
pixels.clear();
pixels.show();
delay(500);
}
*// 빨간색 신호 (5초)*
pixels.setPixelColor(2, pixels.Color(255, 0, 0));
pixels.show();
delay(5000);
pixels.clear();
}
#include <Adafruit_NeoPixel.h>
#define PIN 6 #define NUMPIXELS 4
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() { pixels.begin(); pixels.clear(); pixels.show(); }
void loop() {
// 초록색 신호 (5초)
pixels.setPixelColor(0, pixels.Color(0, 255, 0)); pixels.show(); delay(5000); pixels.clear();
// 노란색 신호 (빠르게 5번 깜빡임)
for (int i = 0; i < 5; i++) { pixels.setPixelColor(1, pixels.Color(255, 255, 0)); pixels.show(); delay(500); pixels.clear(); pixels.show(); delay(500); }
// 빨간색 신호 (5초)
pixels.setPixelColor(2, pixels.Color(255, 0, 0)); pixels.show(); delay(5000); pixels.clear(); }