FastLED 3.9.7
|
Shows how to use a circular noise generator to have a continuous noise effect on a ring of LEDs.
This sketch is fully compatible with the FastLED web compiler. To use it do the following:
pip install fastled
fastled
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 |
#define BRIGHTNESS 96 |
Definition at line 29 of file NoiseRing.ino.
#define COLOR_ORDER GRB |
Definition at line 30 of file NoiseRing.ino.
#define LED_PIN 1 |
Definition at line 28 of file NoiseRing.ino.
#define NUM_LEDS 250 |
Definition at line 31 of file NoiseRing.ino.
#define PIN_PIR 0 |
Definition at line 32 of file NoiseRing.ino.
#define PIR_FALLING_TIME 1000 |
Definition at line 36 of file NoiseRing.ino.
#define PIR_LATCH_MS 60000 |
Definition at line 34 of file NoiseRing.ino.
#define PIR_RISING_TIME 1000 |
Definition at line 35 of file NoiseRing.ino.
void loop | ( | ) |
Definition at line 62 of file NoiseRing.ino.
void setup | ( | ) |
Definition at line 52 of file NoiseRing.ino.
float current_brightness = 0 |
Definition at line 49 of file NoiseRing.ino.
CRGB leds[NUM_LEDS] |
Definition at line 40 of file NoiseRing.ino.
Timer timer |
Definition at line 48 of file NoiseRing.ino.