FastLED 3.9.7
Loading...
Searching...
No Matches
NoisePlusPalette.ino File Reference

Detailed Description

Demonstrates how to mix noise generation with color palettes on a 2D LED matrix.

Definition in file NoisePlusPalette.ino.

#include <FastLED.h>

Go to the source code of this file.

Macros

#define LED_PIN   3
 
#define BRIGHTNESS   96
 
#define LED_TYPE   WS2811
 
#define COLOR_ORDER   GRB
 
#define NUM_LEDS   (kMatrixWidth * kMatrixHeight)
 
#define MAX_DIMENSION   ((kMatrixWidth>kMatrixHeight) ? kMatrixWidth : kMatrixHeight)
 
#define HOLD_PALETTES_X_TIMES_AS_LONG   1
 

Functions

void SetupRandomPalette ()
 
void SetupPurpleAndGreenPalette ()
 
void SetupBlackAndWhiteStripedPalette ()
 
void ChangePaletteAndSettingsPeriodically ()
 
void mapNoiseToLEDsUsingPalette ()
 
uint16_t XY (uint8_t x, uint8_t y)
 
void setup ()
 
void fillnoise8 ()
 
void loop ()
 

Variables

const uint8_t kMatrixWidth = 16
 
const uint8_t kMatrixHeight = 16
 
const bool kMatrixSerpentineLayout = true
 
CRGB leds [kMatrixWidth *kMatrixHeight]
 
uint16_t speed = 20
 
uint16_t scale = 30
 
uint8_t noise [MAX_DIMENSION][MAX_DIMENSION]
 
CRGBPalette16 currentPalette (PartyColors_p)
 
uint8_t colorLoop = 1
 

Macro Definition Documentation

◆ BRIGHTNESS

#define BRIGHTNESS   96

Definition at line 14 of file NoisePlusPalette.ino.

◆ COLOR_ORDER

#define COLOR_ORDER   GRB

Definition at line 16 of file NoisePlusPalette.ino.

◆ HOLD_PALETTES_X_TIMES_AS_LONG

#define HOLD_PALETTES_X_TIMES_AS_LONG   1

Definition at line 210 of file NoisePlusPalette.ino.

◆ LED_PIN

#define LED_PIN   3

Definition at line 13 of file NoisePlusPalette.ino.

◆ LED_TYPE

#define LED_TYPE   WS2811

Definition at line 15 of file NoisePlusPalette.ino.

◆ MAX_DIMENSION

#define MAX_DIMENSION   ((kMatrixWidth>kMatrixHeight) ? kMatrixWidth : kMatrixHeight)

Definition at line 53 of file NoisePlusPalette.ino.

◆ NUM_LEDS

#define NUM_LEDS   (kMatrixWidth * kMatrixHeight)

Definition at line 52 of file NoisePlusPalette.ino.

Function Documentation

◆ ChangePaletteAndSettingsPeriodically()

void ChangePaletteAndSettingsPeriodically ( )

Definition at line 212 of file NoisePlusPalette.ino.

◆ fillnoise8()

void fillnoise8 ( )

Definition at line 107 of file NoisePlusPalette.ino.

◆ loop()

void loop ( )

Definition at line 182 of file NoisePlusPalette.ino.

◆ mapNoiseToLEDsUsingPalette()

void mapNoiseToLEDsUsingPalette ( )

Definition at line 148 of file NoisePlusPalette.ino.

◆ setup()

void setup ( )

Definition at line 93 of file NoisePlusPalette.ino.

◆ SetupBlackAndWhiteStripedPalette()

void SetupBlackAndWhiteStripedPalette ( )

Definition at line 255 of file NoisePlusPalette.ino.

◆ SetupPurpleAndGreenPalette()

void SetupPurpleAndGreenPalette ( )

Definition at line 268 of file NoisePlusPalette.ino.

◆ SetupRandomPalette()

void SetupRandomPalette ( )

Definition at line 241 of file NoisePlusPalette.ino.

◆ XY()

uint16_t XY ( uint8_t x,
uint8_t y )

Definition at line 285 of file NoisePlusPalette.ino.

Variable Documentation

◆ colorLoop

uint8_t colorLoop = 1

Definition at line 79 of file NoisePlusPalette.ino.

◆ kMatrixHeight

const uint8_t kMatrixHeight = 16

Definition at line 20 of file NoisePlusPalette.ino.

◆ kMatrixSerpentineLayout

const bool kMatrixSerpentineLayout = true

Definition at line 23 of file NoisePlusPalette.ino.

◆ kMatrixWidth

const uint8_t kMatrixWidth = 16

Definition at line 19 of file NoisePlusPalette.ino.

◆ leds

CRGB leds[kMatrixWidth *kMatrixHeight]

Definition at line 56 of file NoisePlusPalette.ino.

◆ noise

uint8_t noise[MAX_DIMENSION][MAX_DIMENSION]

Definition at line 76 of file NoisePlusPalette.ino.

◆ scale

uint16_t scale = 30

Definition at line 73 of file NoisePlusPalette.ino.

◆ speed

uint16_t speed = 20

Definition at line 67 of file NoisePlusPalette.ino.