Both sides previous revision Previous revision | Next revision Both sides next revision | ||
fabricademy2017:students:anamaria.martinlopez:week12 [2018/06/20 13:17] anamaria.martinlopez |
fabricademy2017:students:anamaria.martinlopez:week12 [2018/06/20 14:10] anamaria.martinlopez [Colors:] |
||
---|---|---|---|
Line 146: | Line 146: | ||
{{youtube>vC7GrdxOMDg?medium}} | {{youtube>vC7GrdxOMDg?medium}} | ||
- | ====== Colors: ====== | + | ====== Colores: ====== |
\\ | \\ | ||
- | White: 244,244,244\\ | + | Blanco: 244,244,244 \\ |
- | Pink: 234,137,154\\ | + | Rosa: 234,137,154 \\ |
- | Green: 0.250.0\\ | + | Verde: 0,250.0 \\ |
- | Blue: 034,113,179 | + | Azul: 034,113,179 |
+ | |||
+ | include <Adafruit_NeoPixel.h> | ||
+ | |||
+ | \\ | ||
+ | #define NUM_LEDS 4 // Number of NeoPixels\\ | ||
+ | #define PIN 1 // DIGITAL pin # where NeoPixels are connected\\ | ||
+ | // IMPORTANT: Avoid connecting on a live circuit. . .\\ | ||
+ | // if you must, connect GND first.\\ | ||
+ | Adafruit_NeoPixel strip = Adafruit_NeoPixel( NUM_LEDS, PIN) ; | ||
+ | |||
+ | \\ | ||
+ | void setup() {\\ | ||
+ | strip. begin();\\ | ||
+ | strip. setBrightness(100); // 100/255 brightness ( about 40%) //brillo de 0 a 255\\ | ||
+ | strip. show(); // Initialize all pixels to ' off'\\ | ||
+ | } | ||
+ | |||
+ | void loop( ) {\\ | ||
+ | delay (500);\\ | ||
+ | strip. setPixelColor(0,244,244,244); //primer led\\ | ||
+ | strip.show();\\ | ||
+ | delay (500);\\ | ||
+ | strip. setPixelColor(1,234,137,154); //segundo led\\ | ||
+ | strip.show();\\ | ||
+ | delay (500);\\ | ||
+ | strip. setPixelColor(2,0,250,0); //tercer led\\ | ||
+ | strip.show();\\ | ||
+ | delay (500);\\ | ||
+ | strip. setPixelColor(3,034,113,179); // cuarto led\\ | ||
+ | strip.show();\\ | ||
+ | delay (500); | ||
+ | |||
+ | strip. setPixelColor(3,0,0,0); //primer led\\ | ||
+ | strip.show();\\ | ||
+ | delay (500);\\ | ||
+ | strip. setPixelColor(2,0,0,0); //segundo led\\ | ||
+ | strip.show();\\ | ||
+ | delay (500);\\ | ||
+ | strip. setPixelColor(1,0,0,0); //tercer led\\ | ||
+ | strip.show();\\ | ||
+ | delay (500);\\ | ||
+ | strip. setPixelColor(0,0,0,0); // cuarto led\\ | ||
+ | strip.show();\\ | ||
+ | delay (500);\\ | ||
+ | strip.show(); | ||
+ | |||
+ | } | ||