Natural Nerd
LED "fade-
between"
colors
*************
* To use the code for your own projects, update the parameters
* marked with CONFIG.
*/
#include "FastLED.h"
#include <math.h>
/*************************************
* CONFIG
* How many leds are you controlling?
* Change it!
*************************************/
#define NUM_LEDS 1
#define LED_PIN 6
/*************************************
* CONFIG
* Color declarations, RGB style
* Feel free to add more colors
* That way more fades can be created!
*************************************/
int purple[3] = {210, 0, 255};
int peach[3] = {255, 90, 30};
int lime[3] = {50, 255, 30};
/**
* Params: fade_between(color from, color-to, led-array, delay)
*/
void fade_between(int a[3], int b[3], CRGB leds[NUM_LEDS], int del) {
int i, j, steps = 100;
double dsteps = 100.0;
double s1, s2, s3, tmp1, tmp2, tmp3;
s1 = double((b[0] - a[0])) / dsteps;
s2 = double((b[1] - a[1])) / dsteps;
s3 = double((b[2] - a[2])) / dsteps;
FastLED.show();
}