1 X Arduino UNO Rev3
1 X Cable
1 X Project #2 – Lens – LED – Mk1
LensLEDMk2.1.ino
// ***** Don Luc *****
// Software Version Information
// 2.1
#include <Adafruit_NeoPixel.h>
// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 6
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 2
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 500; // delay for half a second
void loop() {
for(int i=0;i<NUMPIXELS;i++){
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setBrightness(125);
pixels.setPixelColor(i, pixels.Color(50,150,50)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
}
}
setup.ino
void setup() {
pixels.begin(); // This initializes the NeoPixel library.
}
Don Luc
