#include <Adafruit_NeoPixel.h> //Include de library of Neopixel
int Power = 11; //Declare the power of light
int PIN = 12; //Declare the pin
#define NUMPIXELS 1
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin(); // Initialize NeoPixel strip object
pinMode(Power,OUTPUT); // Declare the power as onput
digitalWrite(Power, HIGH); // Declate the state of the power
}
void loop() {
pixels.clear(); // Set all pixel colors to 'off'
/*
pixels.setPixelColor()
takes RGB value
from 0,0,0 up to 255, 255, 255
*/
// Here we're using a light blue:
pixels.setPixelColor(0, pixels.Color(161, 204, 209));
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.clear();
// Here we're using a light orange:
pixels.setPixelColor(0, pixels.Color(249, 181, 114));
delay(500);
pixels.show();
pixels.clear();
// Here we're using an opaque green:
pixels.setPixelColor(0, pixels.Color(153, 176, 128));
delay(500);
pixels.show();
pixels.clear();
// Here we're using a gray:
pixels.setPixelColor(0, pixels.Color(183, 183, 183));
delay(500);
pixels.show();
pixels.clear();
// Here we're using a bright yellow:
pixels.setPixelColor(0, pixels.Color(244, 242, 222));
delay(500);
pixels.show();
}
A R D U I N O