Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #define DATA_PIN 11
- #define CLOCK_PIN 13
- #define NUM_LEDS 32
- #define LED_TYPE LPD8806
- #define COLOR_ORDER GRB
- CRGB leds[NUM_LEDS];
- void setup() {
- delay( 3000);
- FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS)
- .setCorrection( TypicalLEDStrip );
- FastLED.setBrightness(29); // tried with low and high values
- }
- void loop() {
- EVERY_N_MILLISECONDS(10){
- pulse(10,110,0);
- }
- FastLED.show();
- }
- void pulse(int R,int G, int B)
- {
- static int brightness = 255;
- static int fadeAmount = -1;
- //fill_solid(leds, NUM_LEDS, CHSV(88,255,brightness)); //hue 88 = mostly green, a little red
- fill_solid(leds, NUM_LEDS, CRGB(R,G,B));
- fadeLightBy(leds, NUM_LEDS, brightness);
- brightness = brightness + fadeAmount;
- if(brightness == 0 || brightness == 255)
- {
- fadeAmount = -fadeAmount ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment