Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 42 additions & 88 deletions esp8266-fastled-webserver/Map.cpp

Large diffs are not rendered by default.

293 changes: 140 additions & 153 deletions esp8266-fastled-webserver/Noise.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions esp8266-fastled-webserver/Pacifica.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void pacifica_one_layer( CRGBPalette16& p, uint16_t cistart, uint16_t wavescale,
uint8_t sindex8 = scale16( sindex16, 240);
CRGB c = ColorFromPalette( p, sindex8, bri, LINEARBLEND);
#if IS_FIBONACCI
uint16_t idx = useFibonacciOrder ? physicalToFibonacci[i] : i;
uint16_t idx = useFibonacciOrder ? fibonacciToPhysical[i] : i;
#else
(void)useFibonacciOrder; // unused parameter
uint16_t idx = i;
Expand All @@ -75,7 +75,7 @@ void pacifica_add_whitecaps(bool useFibonacciOrder)

for( uint16_t i = 0; i < NUM_PIXELS; i++) {
#if IS_FIBONACCI
uint16_t idx = useFibonacciOrder ? physicalToFibonacci[i] : i;
uint16_t idx = useFibonacciOrder ? fibonacciToPhysical[i] : i;
#else
(void)useFibonacciOrder; // unused parameter
uint16_t idx = i;
Expand All @@ -97,7 +97,7 @@ void pacifica_deepen_colors(bool useFibonacciOrder)
{
for( uint16_t i = 0; i < NUM_PIXELS; i++) {
#if IS_FIBONACCI
uint16_t idx = useFibonacciOrder ? physicalToFibonacci[i] : i;
uint16_t idx = useFibonacciOrder ? fibonacciToPhysical[i] : i;
#else
(void)useFibonacciOrder; // unused parameter
uint16_t idx = i;
Expand Down
22 changes: 10 additions & 12 deletions esp8266-fastled-webserver/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,10 @@ extern CRGB leds[NUM_PIXELS];
#endif

#if HAS_COORDINATE_MAP
extern const uint8_t coordsX [NUM_PIXELS];
extern const uint8_t coordsY [NUM_PIXELS];
extern const uint8_t angles [NUM_PIXELS];
#endif

#if HAS_POLAR_COORDS
extern const uint8_t radii[NUM_PIXELS]; // needed in noise.cpp
extern const uint8_t coordsX [NUM_PIXELS];
extern const uint8_t coordsY [NUM_PIXELS];
extern const uint8_t angles [NUM_PIXELS];
extern const uint8_t (&radiusProxy) [NUM_PIXELS];
#endif

#include "include/GradientPalettes.hpp"
Expand Down Expand Up @@ -278,10 +275,11 @@ void radarSweepPalette();
void radiusPalette();
void angleGradientPalette();
void radiusGradientPalette();
void drawAnalogClock();
void antialiasPixelAR(uint8_t angle, uint8_t dAngle, uint8_t startRadius, uint8_t endRadius, CRGB color, CRGB leds[] = leds, int _NUM_PIXELS = NUM_PIXELS);
#endif
// map.h -- only when product defines IS_FIBONACCI to be true
#if IS_FIBONACCI
void drawAnalogClock();
void drawSpiralAnalogClock13();
void drawSpiralAnalogClock21();
void drawSpiralAnalogClock34();
Expand All @@ -290,10 +288,11 @@ void drawSpiralAnalogClock89();
void drawSpiralAnalogClock21and34();
void drawSpiralAnalogClock13_21_and_34();
void drawSpiralAnalogClock34_21_and_13();
void antialiasPixelAR(uint8_t angle, uint8_t dAngle, uint8_t startRadius, uint8_t endRadius, CRGB color, CRGB leds[] = leds, int _NUM_PIXELS = NUM_PIXELS);
#endif

// noise.h -- always defined
void paletteNoise();
void gradientPaletteNoise();
void rainbowNoise();
void rainbowStripeNoise();
void partyNoise();
Expand All @@ -306,8 +305,6 @@ void oceanNoise();
void blackAndWhiteNoise();
void blackAndBlueNoise();

// noise.h -- only when product defines HAS_POLAR_COORDS to be true
#if HAS_POLAR_COORDS
void palettePolarNoise();
void gradientPalettePolarNoise();
void rainbowPolarNoise();
Expand All @@ -321,7 +318,8 @@ void lavaPolarNoise();
void oceanPolarNoise();
void blackAndWhitePolarNoise();
void blackAndBluePolarNoise();
#endif



// pacifica.h / prideplayground.h / colorwavesplayground.h
void pacifica_loop();
Expand Down
6 changes: 0 additions & 6 deletions esp8266-fastled-webserver/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,6 @@
#if IS_FIBONACCI && (!HAS_COORDINATE_MAP)
#error "IS_FIBONACCI is true, so HAS_COORDINATE_MAP must also be true (but is not)"
#endif
#if !defined(HAS_POLAR_COORDS) || ((HAS_POLAR_COORDS != 0) && (HAS_POLAR_COORDS != 1))
#error "HAS_POLAR_COORDS must be defined to zero or one"
#endif
#if HAS_POLAR_COORDS && (!HAS_COORDINATE_MAP)
#error "HAS_POLAR_COORDS is true, so HAS_COORDINATE_MAP must also be true (but is not)"
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#error "PARALLEL_OUTPUT_CHANNELS must be defined"
#elif (PARALLEL_OUTPUT_CHANNELS == 1)
Expand Down
18 changes: 7 additions & 11 deletions esp8266-fastled-webserver/esp8266-fastled-webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ void dimAll(byte value)

// List of patterns to cycle through. Each is defined as a separate function below.

// NOTE: HAS_POLAR_COORDS implies HAS_COORDINATE_MAP
// IS_FIBONACCI implies HAS_COORDINATE_MAP
// NOTE: IS_FIBONACCI implies HAS_COORDINATE_MAP

const PatternAndName patterns[] = {
{ pride, "Pride" },
Expand Down Expand Up @@ -142,10 +141,8 @@ const PatternAndName patterns[] = {
{ xGradientPalette, "X Axis Gradient Palette" },
{ yGradientPalette, "Y Axis Gradient Palette" },
{ xyGradientPalette, "XY Axis Gradient Palette" },
#endif

#if HAS_POLAR_COORDS
// noise patterns (Polar variations)
// noise patterns
{ gradientPalettePolarNoise, "Gradient Palette Polar Noise" },
{ palettePolarNoise, "Palette Polar Noise" },
{ firePolarNoise, "Fire Polar Noise" },
Expand All @@ -159,10 +156,9 @@ const PatternAndName patterns[] = {
{ oceanPolarNoise, "Ocean Polar Noise" },
{ blackAndWhitePolarNoise, "Black & White Polar Noise" },
{ blackAndBluePolarNoise, "Black & Blue Polar Noise" },
#endif

#if HAS_COORDINATE_MAP
// noise patterns
{ gradientPaletteNoise, "Gradient Palette Noise" },
{ paletteNoise, "Palette Noise" },
{ fireNoise, "Fire Noise" },
{ fireNoise2, "Fire Noise 2" },
{ lavaNoise, "Lava Noise" },
Expand All @@ -174,11 +170,11 @@ const PatternAndName patterns[] = {
{ oceanNoise, "Ocean Noise" },
{ blackAndWhiteNoise, "Black & White Noise" },
{ blackAndBlueNoise, "Black & Blue Noise" },

{ drawAnalogClock, "Analog Clock" },
#endif

#if IS_FIBONACCI
{ drawAnalogClock, "Analog Clock" },

{ drawSpiralAnalogClock13, "Spiral Analog Clock 13" },
{ drawSpiralAnalogClock21, "Spiral Analog Clock 21" },
{ drawSpiralAnalogClock34, "Spiral Analog Clock 34" },
Expand Down Expand Up @@ -733,7 +729,7 @@ void loop() {
// Call the current pattern function once, updating the 'leds' array
patterns[currentPatternIndex].pattern();

#if IS_FIBONACCI
#if HAS_COORDINATE_MAP
if (showClock) drawAnalogClock();
#endif

Expand Down
8 changes: 2 additions & 6 deletions esp8266-fastled-webserver/include/configs/product/1628rings.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,17 @@
#define DEFAULT_COLOR_CORRECTION UncorrectedColor // 1628-Rings did not specify; This is FastLED default
#endif
#if !defined(NAME_PREFIX)
#define NAME_PREFIX "ESP8266-"
#define NAME_PREFIX "sol-v2-"
#endif
#if !defined(PRODUCT_FRIENDLY_NAME)
#define PRODUCT_FRIENDLY_NAME "ESP8266 FastLED Webserver"
#define PRODUCT_FRIENDLY_NAME "Sol v2"
#endif
#if !defined(IS_FIBONACCI)
#define IS_FIBONACCI 0
#endif
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 1
#endif
// TODO: combine HAS_POLAR_COORDS with HAS_COORDINATE_MAP
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 1
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS) // WARNING: Refresh rate for 1628 pixels over single output is ~15 frames / second MAXIMUM....
#define PARALLEL_OUTPUT_CHANNELS 1
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 1
#endif
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#define PARALLEL_OUTPUT_CHANNELS 1
#endif
Expand Down
3 changes: 0 additions & 3 deletions esp8266-fastled-webserver/include/configs/product/default.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 0
#endif
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#define PARALLEL_OUTPUT_CHANNELS 1
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 0
#endif
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#define PARALLEL_OUTPUT_CHANNELS 6
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 1
#endif
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#define PARALLEL_OUTPUT_CHANNELS 1
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 1
#endif
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#define PARALLEL_OUTPUT_CHANNELS 1
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 1
#endif
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#define PARALLEL_OUTPUT_CHANNELS 1
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 1
#endif
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#define PARALLEL_OUTPUT_CHANNELS 4
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 1
#endif
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#define PARALLEL_OUTPUT_CHANNELS 1
#endif
Expand Down
3 changes: 0 additions & 3 deletions esp8266-fastled-webserver/include/configs/product/kraken64.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@
#if !defined(HAS_COORDINATE_MAP)
#define HAS_COORDINATE_MAP 1
#endif
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif
#if !defined(PARALLEL_OUTPUT_CHANNELS)
#define PARALLEL_OUTPUT_CHANNELS 1
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@
#define HAS_COORDINATE_MAP 1
#endif

// HAS_POLAR_COORDS is true when there are mappings to define
// ... TODO: add definition for polar coordinates define ...
#if !defined(HAS_POLAR_COORDS)
#define HAS_POLAR_COORDS 0
#endif


// PARALLEL_OUTPUT_CHANNELS indicates the number of independent channels
// that should be configured. When this value == 1, DATA_PIN is used to
// control all pixels.
Expand Down