Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Just a FastLED palette demonstration.
- */
- #include <FastLED.h> // FastLED library.
- #define LED_DT 12 // Serial data pin for WS2812 or WS2801.
- #define COLOR_ORDER GRB // Are they GRB for WS2812 and GBR for APA102
- #define LED_TYPE WS2812 // What kind of strip are you using? WS2812, APA102. . .
- #define NUM_LEDS 40 // Number of LED's.
- uint8_t max_bright = 128; // Overall brightness definition. It can be changed on the fly.
- struct CRGB leds[NUM_LEDS]; // Initialize our LED array.
- TBlendType currentBlending = LINEARBLEND;
- CRGBPalette16 test_pal = CRGBPalette16(CHSV( 120, 255, 25), CHSV( 20, 25, 55), CHSV( 30, 255, 105), CHSV( 40, 255, 155),
- CHSV( 90, 255, 205), CHSV( 110, 255, 255), CHSV( 178, 255, 255), CHSV( 210, 55, 155),
- CHSV( 220, 255, 255), CHSV( 230, 255, 255), CHSV( 140, 55, 55), CHSV( 245, 255, 255),
- CHSV( 246, 255, 255), CHSV( 247, 155, 55), CHSV( 250, 255, 255), CHSV( 252, 255, 255));
- void setup() {
- delay(1000);
- LEDS.addLeds<LED_TYPE, LED_DT,COLOR_ORDER>(leds, NUM_LEDS);
- FastLED.setBrightness(max_bright);
- }
- void loop() {
- bettertest();
- FastLED.show();
- }
- void bettertest() {
- uint8_t i = millis()/16;
- fill_palette (leds, NUM_LEDS, i, 1, test_pal,255 , LINEARBLEND);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement