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

Detailed Description

Twinkling "holiday" lights that fade in and out.

Definition in file TwinkleFox.ino.

#include "FastLED.h"

Go to the source code of this file.

Macros

#define NUM_LEDS   100
 
#define LED_TYPE   WS2811
 
#define COLOR_ORDER   GRB
 
#define DATA_PIN   3
 
#define VOLTS   12
 
#define MAX_MA   4000
 
#define TWINKLE_SPEED   4
 
#define TWINKLE_DENSITY   5
 
#define SECONDS_PER_PALETTE   30
 
#define AUTO_SELECT_BACKGROUND_COLOR   0
 
#define COOL_LIKE_INCANDESCENT   1
 
#define Holly_Green   0x00580c
 
#define Holly_Red   0xB00402
 
#define HALFFAIRY   ((CRGB::FairyLight & 0xFEFEFE) / 2)
 
#define QUARTERFAIRY   ((CRGB::FairyLight & 0xFCFCFC) / 4)
 
#define C9_Red   0xB80400
 
#define C9_Orange   0x902C02
 
#define C9_Green   0x046002
 
#define C9_Blue   0x070758
 
#define C9_White   0x606820
 
#define Ice_Blue1   0x0C1040
 
#define Ice_Blue2   0x182080
 
#define Ice_Blue3   0x5080C0
 

Functions

void setup ()
 
void loop ()
 
void drawTwinkles (CRGBSet &L)
 
CRGB computeOneTwinkle (uint32_t ms, uint8_t salt)
 
uint8_t attackDecayWave8 (uint8_t i)
 
void coolLikeIncandescent (CRGB &c, uint8_t phase)
 
void chooseNextColorPalette (CRGBPalette16 &pal)
 

Variables

CRGBArray< NUM_LEDS > leds
 
CRGB gBackgroundColor = CRGB::Black
 
CRGBPalette16 gCurrentPalette
 
CRGBPalette16 gTargetPalette
 
const TProgmemRGBPalette16 RedGreenWhite_p
 
const TProgmemRGBPalette16 Holly_p
 
const TProgmemRGBPalette16 RedWhite_p
 
const TProgmemRGBPalette16 BlueWhite_p
 
const TProgmemRGBPalette16 FairyLight_p
 
const TProgmemRGBPalette16 Snow_p
 
const TProgmemRGBPalette16 RetroC9_p
 
const TProgmemRGBPalette16 Ice_p
 
const TProgmemRGBPalette16ActivePaletteList []
 

Macro Definition Documentation

◆ AUTO_SELECT_BACKGROUND_COLOR

#define AUTO_SELECT_BACKGROUND_COLOR   0

Definition at line 105 of file TwinkleFox.ino.

◆ C9_Blue

#define C9_Blue   0x070758

Definition at line 336 of file TwinkleFox.ino.

◆ C9_Green

#define C9_Green   0x046002

Definition at line 335 of file TwinkleFox.ino.

◆ C9_Orange

#define C9_Orange   0x902C02

Definition at line 334 of file TwinkleFox.ino.

◆ C9_Red

#define C9_Red   0xB80400

Definition at line 333 of file TwinkleFox.ino.

◆ C9_White

#define C9_White   0x606820

Definition at line 337 of file TwinkleFox.ino.

◆ COLOR_ORDER

#define COLOR_ORDER   GRB

Definition at line 10 of file TwinkleFox.ino.

◆ COOL_LIKE_INCANDESCENT

#define COOL_LIKE_INCANDESCENT   1

Definition at line 110 of file TwinkleFox.ino.

◆ DATA_PIN

#define DATA_PIN   3

Definition at line 11 of file TwinkleFox.ino.

◆ HALFFAIRY

#define HALFFAIRY   ((CRGB::FairyLight & 0xFEFEFE) / 2)

Definition at line 316 of file TwinkleFox.ino.

◆ Holly_Green

#define Holly_Green   0x00580c

Definition at line 290 of file TwinkleFox.ino.

◆ Holly_Red

#define Holly_Red   0xB00402

Definition at line 291 of file TwinkleFox.ino.

◆ Ice_Blue1

#define Ice_Blue1   0x0C1040

Definition at line 347 of file TwinkleFox.ino.

◆ Ice_Blue2

#define Ice_Blue2   0x182080

Definition at line 348 of file TwinkleFox.ino.

◆ Ice_Blue3

#define Ice_Blue3   0x5080C0

Definition at line 349 of file TwinkleFox.ino.

◆ LED_TYPE

#define LED_TYPE   WS2811

Definition at line 9 of file TwinkleFox.ino.

◆ MAX_MA

#define MAX_MA   4000

Definition at line 14 of file TwinkleFox.ino.

◆ NUM_LEDS

#define NUM_LEDS   100

Definition at line 8 of file TwinkleFox.ino.

◆ QUARTERFAIRY

#define QUARTERFAIRY   ((CRGB::FairyLight & 0xFCFCFC) / 4)

Definition at line 317 of file TwinkleFox.ino.

◆ SECONDS_PER_PALETTE

#define SECONDS_PER_PALETTE   30

Definition at line 89 of file TwinkleFox.ino.

◆ TWINKLE_DENSITY

#define TWINKLE_DENSITY   5

Definition at line 86 of file TwinkleFox.ino.

◆ TWINKLE_SPEED

#define TWINKLE_SPEED   4

Definition at line 81 of file TwinkleFox.ino.

◆ VOLTS

#define VOLTS   12

Definition at line 13 of file TwinkleFox.ino.

Function Documentation

◆ attackDecayWave8()

uint8_t attackDecayWave8 ( uint8_t i)

Definition at line 259 of file TwinkleFox.ino.

◆ chooseNextColorPalette()

void chooseNextColorPalette ( CRGBPalette16 & pal)

Definition at line 376 of file TwinkleFox.ino.

◆ computeOneTwinkle()

CRGB computeOneTwinkle ( uint32_t ms,
uint8_t salt )

Definition at line 221 of file TwinkleFox.ino.

◆ coolLikeIncandescent()

void coolLikeIncandescent ( CRGB & c,
uint8_t phase )

Definition at line 272 of file TwinkleFox.ino.

◆ drawTwinkles()

void drawTwinkles ( CRGBSet & L)

Definition at line 147 of file TwinkleFox.ino.

◆ loop()

void loop ( )

Definition at line 126 of file TwinkleFox.ino.

◆ setup()

void setup ( )

Definition at line 116 of file TwinkleFox.ino.

Variable Documentation

◆ ActivePaletteList

const TProgmemRGBPalette16* ActivePaletteList[]
Initial value:
= {
&RetroC9_p,
&BlueWhite_p,
&FairyLight_p,
&RedGreenWhite_p,
&RedWhite_p,
&Snow_p,
&Holly_p,
&Ice_p
}
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
const TProgmemRGBPalette16 RainbowColors_p
HSV Rainbow.

Definition at line 361 of file TwinkleFox.ino.

◆ BlueWhite_p

◆ FairyLight_p

◆ gBackgroundColor

CRGB gBackgroundColor = CRGB::Black

Definition at line 97 of file TwinkleFox.ino.

◆ gCurrentPalette

CRGBPalette16 gCurrentPalette

Definition at line 113 of file TwinkleFox.ino.

◆ gTargetPalette

CRGBPalette16 gTargetPalette

Definition at line 114 of file TwinkleFox.ino.

◆ Holly_p

const TProgmemRGBPalette16 Holly_p
Initial value:
=
{ Holly_Green, Holly_Green, Holly_Green, Holly_Green,
Holly_Green, Holly_Green, Holly_Green, Holly_Green,
Holly_Green, Holly_Green, Holly_Green, Holly_Green,
Holly_Green, Holly_Green, Holly_Green, Holly_Red
}

Definition at line 292 of file TwinkleFox.ino.

◆ Ice_p

const TProgmemRGBPalette16 Ice_p
Initial value:
=
{
Ice_Blue1, Ice_Blue1, Ice_Blue1, Ice_Blue1,
Ice_Blue1, Ice_Blue1, Ice_Blue1, Ice_Blue1,
Ice_Blue1, Ice_Blue1, Ice_Blue1, Ice_Blue1,
Ice_Blue2, Ice_Blue2, Ice_Blue2, Ice_Blue3
}

Definition at line 350 of file TwinkleFox.ino.

◆ leds

CRGBArray<NUM_LEDS> leds

Definition at line 76 of file TwinkleFox.ino.

◆ RedGreenWhite_p

◆ RedWhite_p

◆ RetroC9_p

const TProgmemRGBPalette16 RetroC9_p
Initial value:
=
{ C9_Red, C9_Orange, C9_Red, C9_Orange,
C9_Orange, C9_Red, C9_Orange, C9_Red,
C9_Green, C9_Green, C9_Green, C9_Green,
C9_Blue, C9_Blue, C9_Blue,
C9_White
}

Definition at line 338 of file TwinkleFox.ino.

◆ Snow_p

const TProgmemRGBPalette16 Snow_p
Initial value:
=
{ 0x304048, 0x304048, 0x304048, 0x304048,
0x304048, 0x304048, 0x304048, 0x304048,
0x304048, 0x304048, 0x304048, 0x304048,
0x304048, 0x304048, 0x304048, 0xE0F0FF }

Definition at line 325 of file TwinkleFox.ino.