Hello,
Hunted for weeks as lost sketch, did find one on backup but not the sketch needing. Tried the online animators, but not same when run. This is as close as can find, but need to change to red, fade in out different positions. i would be most grateful, as no clue on coding...
#include "FastLED.h"
#define NUM_LEDS 30
CRGB leds[NUM_LEDS];
#define PIN 12
void setup()
{
FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
}
void loop() {
FadeInOut(0xff, 0xff, 0xff);
}
void FadeInOut(byte red, byte green, byte blue){
float r, g, b;
for(int k = 0; k < 255; k=k+1) {
r = (k/255.0)*red;
g = (k/255.0)*green;
b = (k/255.0)*blue;
setAll(r,g,b);
}
for(int k = 255; k >= 0; k=k-9) {
r = (k/255.0)*red;
g = (k/255.0)*green;
b = (k/255.0)*blue;
setAll(r,g,b);
}
}
void showStrip() {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.show();
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
FastLED.show();
#endif
}
void setPixel(int Pixel, byte red, byte green, byte blue) {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.setPixelColor(Pixel, strip.Color(red, green, blue));
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
leds[Pixel].r = red;
leds[Pixel].g = green;
leds[Pixel].b = blue;
#endif
}
void setAll(byte red, byte green, byte blue) {
for(int i = 0; i < NUM_LEDS; i++ ) {
setPixel(i, red, green, blue);
}
showStrip();
}
type or paste code here