Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Main Goal: Analog Strip fades from one defined hue to a second defined hue
- //Secondary Goal: 4 analog strips repeating this action with each delayed slightly. (2 Variables to define delay amount and overall speed fade occurs)
- #include "FastLED.h"
- #include "colorutils.h"
- // fast led constants
- #define NUM_LEDS 1 // change to the number of LEDs in your strip
- #define REDPIN 5
- #define GREENPIN 6
- #define BLUEPIN 3
- // hold the values for led in your strip
- CRGB leds;
- // blend variables
- fraction = 0.1 //steps? or speed of transition?
- CHSV color1 = CHSV(0, 255, 100);
- CHSV color2 = CHSV(180, 255, 100);
- void showAnalogRGB( const CRGB& rgb)
- {
- analogWrite(REDPIN, rgb.r );
- analogWrite(GREENPIN, rgb.g );
- analogWrite(BLUEPIN, rgb.b );
- }
- void setup()
- {
- // not needed since analog strip?
- // FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
- }
- void loop()
- {
- /*
- // Pixel blending
- // blend - computes a new color blended some fraction of the way
- // between two other colors.
- CRGB blend( const CRGB& p1, const CRGB& p2, fract8 amountOfP2 );
- CHSV blend( const CHSV& p1, const CHSV& p2, fract8 amountOfP2,
- TGradientDirectionCode directionCode = SHORTEST_HUES );
- */
- colorutils.blend(color1, color2, fraction, SHORTEST_HUES);
- showAnalogRGB(CHSV(?, ?, ?));
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment