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

Detailed Description

Shows how to use a circular noise generator to have a continuous noise effect on a ring of LEDs.

Author
Zach Vorhies

This sketch is fully compatible with the FastLED web compiler. To use it do the following:

  1. Install Fastled: pip install fastled
  2. cd into this examples page.
  3. Run the FastLED web compiler at root: fastled
  4. When the compiler is done a web page will open.

Definition in file NoiseRing.ino.

#include <Arduino.h>
#include <stdio.h>
#include "fl/json.h"
#include "fl/math_macros.h"
#include "noisegen.h"
#include "fl/screenmap.h"
#include "fl/slice.h"
#include "fl/ui.h"
#include "FastLED.h"
#include "sensors/pir.h"
#include "timer.h"
#include <iostream>

Go to the source code of this file.

Macros

#define LED_PIN   1
 
#define BRIGHTNESS   96
 
#define COLOR_ORDER   GRB
 
#define NUM_LEDS   250
 
#define PIN_PIR   0
 
#define PIR_LATCH_MS   60000
 
#define PIR_RISING_TIME   1000
 
#define PIR_FALLING_TIME   1000
 

Functions

void setup ()
 
void loop ()
 

Variables

CRGB leds [NUM_LEDS]
 
Slider brightness ("Brightness", 1, 0, 1)
 
Slider scale ("Scale", 4,.1, 4,.1)
 
Slider timeBitshift ("Time Bitshift", 5, 0, 16, 1)
 
Slider timescale ("Time Scale", 1,.1, 10,.1)
 
PirAdvanced pir (PIN_PIR, PIR_LATCH_MS, PIR_RISING_TIME, PIR_FALLING_TIME)
 
Timer timer
 
float current_brightness = 0
 

Macro Definition Documentation

◆ BRIGHTNESS

#define BRIGHTNESS   96

Definition at line 29 of file NoiseRing.ino.

◆ COLOR_ORDER

#define COLOR_ORDER   GRB

Definition at line 30 of file NoiseRing.ino.

◆ LED_PIN

#define LED_PIN   1

Definition at line 28 of file NoiseRing.ino.

◆ NUM_LEDS

#define NUM_LEDS   250

Definition at line 31 of file NoiseRing.ino.

◆ PIN_PIR

#define PIN_PIR   0

Definition at line 32 of file NoiseRing.ino.

◆ PIR_FALLING_TIME

#define PIR_FALLING_TIME   1000

Definition at line 36 of file NoiseRing.ino.

◆ PIR_LATCH_MS

#define PIR_LATCH_MS   60000

Definition at line 34 of file NoiseRing.ino.

◆ PIR_RISING_TIME

#define PIR_RISING_TIME   1000

Definition at line 35 of file NoiseRing.ino.

Function Documentation

◆ loop()

void loop ( )

Definition at line 62 of file NoiseRing.ino.

◆ setup()

void setup ( )

Definition at line 52 of file NoiseRing.ino.

Variable Documentation

◆ current_brightness

float current_brightness = 0

Definition at line 49 of file NoiseRing.ino.

◆ leds

CRGB leds[NUM_LEDS]

Definition at line 40 of file NoiseRing.ino.

◆ timer

Timer timer

Definition at line 48 of file NoiseRing.ino.