#include <Adafruit_NeoPixel.h> //Include de library of Neopixel
int Power = 11; //Declare the power of light
int PIN = PB4; //Declare the pin
#define NUMPIXELS 6
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 I'm using a light red, light blue and the combination of both (purple):
pixels.setPixelColor(0, pixels.Color(255, 0, 0)); // Color Red
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.setPixelColor(2, pixels.Color(0, 0, 255)); // Color Blue
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.setPixelColor(1, pixels.Color(128, 0, 128)); // Color Purple
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.clear();
// Here I'm using a light red, light yellow and the combination of both (orange):
pixels.setPixelColor(0, pixels.Color(255, 0, 0)); // Color Red
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.setPixelColor(5, pixels.Color(255, 255, 0)); // Color Yellow
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.setPixelColor(3, pixels.Color(255, 140, 0)); // Color Orange
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.clear();
// Here I'm using a light blue, light yellow and the combination of both (green):
pixels.setPixelColor(2, pixels.Color(0, 0, 255)); // Color Blue
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.setPixelColor(5, pixels.Color(255, 255, 0)); // Color Yellow
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.setPixelColor(4, pixels.Color(0, 128, 0)); // Color Green
delay(500); // Determinate the duration of the light
pixels.show(); // Set the updated pixel colors to the hadware
pixels.clear();
}
A R D U I N O