230 if( ( delta > 400 ) && ( delta < 900 ) ){
233 if( ( delta > 50 ) && ( delta < 450 ) ){
235 Serial.println( F(
"Clap pattern match!" ) );
286 hue = (uint8_t)( (
unsigned long)( hue + millis() / 100 ) % 255 );
294 hue = (uint8_t)( (
unsigned long)( millis() / 100 ) % 255 );
323 value = ( sin( (
float)millis() / 500.0 + (
float)i / (
float)
LIGHT_STRIP_SIZE * TWO_PI * 2.0 ) / 2.0 + 0.5 ) * 255;
370 static bool generate =
true;
373 value = ( sin( (
float)millis() / 1500.0 ) );
386 hue = random( 0, 255 );
441 skullLightBuffer[ i ].setHSV( (uint8_t)( hue + 128 ), 255, (uint8_t)value );
463 static float hueFiltered = 0.0;
468 static float speed = 0.0;
473 static uint16_t peakCounter = 0;
476 static float skullValue = 128.0;
479 static uint8_t skullHue = 0;
483 hue = (uint8_t)( (
unsigned long)( millis() / 100 ) % 255 );
486 hueFiltered = 0.1 * (float)hue + 0.9 * hueFiltered;
489 skullValue = 0.1 * (float)50.0 + 0.9 * skullValue;
503 hueFiltered = (float)( (uint8_t)( ( (uint8_t)hue ) + 128 ) );
514 if( peakCounter > 300 ){
537 if( peakCounter > 0 ){
544 if( speed > TWO_PI ){
563 value = ( sin( (
float)millis() / 2000.0 + (
float)i / (
float)
LIGHT_STRIP_SIZE * TWO_PI * 2.0 + speed ) / 2.0 + 0.5 ) * 255;
void clapMelody()
Generate clap melody.
void update()
Update function.
bool peak
Flag, that indicates a peak event.
void fogMachineEnable()
Enable the humidifier.
void lightModeMusicUpdate()
Update function for the music mode.
int fadeDirection
Stores the direction and speed of the fading.
bool prevPeak
Flag for peak detection. It is used for the clap detection.
void lightInit()
Initialize the LEDs.
bool lightStateOn
This is a flag, that shows the actual state of the lighting.
unsigned long peakTimes[4]
This array is used for the clap detection.
void lightUpdate()
Update function for the lighting.
void lightOn()
Turn on the lighting.
unsigned long sampleTimer
Stores the last system time when the last sample update event happened.
void lightModeKomodoUpdate()
Update function for the komodo mode.
void lightToggle()
Toggle the lighting.
void lightModeCandleUpdate()
Update function for the candle mode.
void lightModePulseUpdate()
Update function for the pulse mode.
CRGB skullLightBuffer[LIGHT_SKULL_SIZE]
Pixel buffer for the LED disc.
int fadedBrightness
The actual brightness of the strips are calculated to this variable.
void lightModeColorUpdate()
Update function for the color mode.
void lightOff()
Turn off the lighting.
unsigned long lightTimer
Stores the last system time when the last light update event happened.
bool prevBeat
Flag for beat detection. It is used for the music visualizer.
void lightModeRainbowUpdate()
Update function for the rainbow mode.
CRGB stripLightBuffer[LIGHT_STRIP_SIZE]
Pixel buffer for the LED strip.
#define LIGHT_SKULL_SIZE
Number of LEDs on the LED disc.
#define LIGHT_STRIP_PIN
The LED strip is connected to pin 12 on the Arduino.
#define LIGHT_SKULL_PIN
The LED disc is connected to pin 11 on the Arduino.
#define LIGHT_FADE_RATE
The speed of dimming when turning on or off the lighting.
#define LIGHT_STRIP_SIZE
Number of LEDs on the LED strip.
#define LIGHT_UPDATE_RATE
Time between two LED updates in ms.
#define SAMPLE_UPDATE_RATE
It is used for the clap switch.
enum frontState_t frontState
Store the state of the front panel.
@ FRONT_CLOSE
Front is closed.
musicChannel peak
Peak detector object.