first commit
This commit is contained in:
commit
5893b00dd2
1669 changed files with 1982740 additions and 0 deletions
91
libraries/FastLED/examples/FunkyClouds/FunkyClouds.ino
Normal file
91
libraries/FastLED/examples/FunkyClouds/FunkyClouds.ino
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
TODO:
|
||||
|
||||
example show oscis+p
|
||||
document caleidoscopes better
|
||||
write better caleidoscopes...
|
||||
improve and document emitters and oszillators
|
||||
explaining one example step by step:
|
||||
goal? what? how? why?
|
||||
gridmapping for rotation + zoom
|
||||
good interpolation for other matrix dimensions than 16*16
|
||||
more move & stream functions
|
||||
layers
|
||||
palettes
|
||||
link effects to areas
|
||||
1D examples
|
||||
2d example with more than 2 sines
|
||||
speed up MSGEQ7 readings
|
||||
|
||||
|
||||
DONE:
|
||||
25.6. creating basic structure
|
||||
setting up basic examples
|
||||
26.6. MSGEQ7 Support
|
||||
wrote more examples
|
||||
27.6. improved documentation
|
||||
added Move
|
||||
added AutoRun
|
||||
TODO list
|
||||
Copy
|
||||
29.6. rotate+mirror triangle
|
||||
more examples
|
||||
30.6. RenderCustomMatrix
|
||||
added more comments
|
||||
alpha version released
|
||||
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
Funky Clouds Compendium (alpha version)
|
||||
by Stefan Petrick
|
||||
|
||||
An ever growing list of examples, tools and toys
|
||||
for creating one- and twodimensional LED effects.
|
||||
|
||||
Dedicated to the users of the FastLED v2.1 library
|
||||
by Daniel Garcia and Mark Kriegsmann.
|
||||
|
||||
Provides basic and advanced helper functions.
|
||||
Contains many examples how to creatively combine them.
|
||||
|
||||
Tested @ATmega2560 (runs propably NOT on an Uno or
|
||||
anything else with less than 4kB RAM)
|
||||
*/
|
||||
|
||||
#include "FastLED.h"
|
||||
#include "defs.h"
|
||||
#include "funky.h"
|
||||
|
||||
/*
|
||||
-------------------------------------------------------------------
|
||||
Init Inputs and Outputs: LEDs and MSGEQ7
|
||||
-------------------------------------------------------------------
|
||||
*/
|
||||
void setup() {
|
||||
// use the following line only when working with a 16*16
|
||||
// and delete everything in the function RenderCustomMatrix()
|
||||
// at the end of the code; edit XY() to change your matrix layout
|
||||
// right now it is doing a serpentine mapping
|
||||
|
||||
// just for debugging:
|
||||
// Serial.begin(9600);
|
||||
Serial.begin(38400);
|
||||
InitFunky();
|
||||
}
|
||||
|
||||
/*
|
||||
-------------------------------------------------------------------
|
||||
The main program
|
||||
-------------------------------------------------------------------
|
||||
*/
|
||||
void loop() {
|
||||
AutoRun();
|
||||
// Comment AutoRun out and test examples seperately here
|
||||
|
||||
// Dots2();
|
||||
|
||||
// For discovering parameters of examples I reccomend to
|
||||
// tinker with a renamed copy ...
|
||||
}
|
||||
33
libraries/FastLED/examples/FunkyClouds/defs.h
Normal file
33
libraries/FastLED/examples/FunkyClouds/defs.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
// define your LED hardware setup here
|
||||
#define CHIPSET WS2812B
|
||||
#define LED_PIN 13
|
||||
#define COLOR_ORDER GRB
|
||||
|
||||
// set master brightness 0-255 here to adjust power consumption
|
||||
// and light intensity
|
||||
#define BRIGHTNESS 60
|
||||
|
||||
// enter your custom matrix size if it is NOT a 16*16 and
|
||||
// check in that case the setup part and
|
||||
// RenderCustomMatrix() and
|
||||
// ShowFrame() for more comments
|
||||
#define CUSTOM_WIDTH 8
|
||||
#define CUSTOM_HEIGHT 8
|
||||
|
||||
// MSGEQ7 wiring on spectrum analyser shield
|
||||
#define MSGEQ7_STROBE_PIN 4
|
||||
#define MSGEQ7_RESET_PIN 5
|
||||
#define AUDIO_LEFT_PIN 0
|
||||
#define AUDIO_RIGHT_PIN 1
|
||||
|
||||
|
||||
// all 2D effects will be calculated in this matrix size
|
||||
// do not touch
|
||||
#define WIDTH 16
|
||||
#define HEIGHT 16
|
||||
|
||||
// number of LEDs based on fixed calculation matrix size
|
||||
// do not touch
|
||||
#define NUM_LEDS (WIDTH * HEIGHT)
|
||||
1310
libraries/FastLED/examples/FunkyClouds/funky.cpp
Normal file
1310
libraries/FastLED/examples/FunkyClouds/funky.cpp
Normal file
File diff suppressed because it is too large
Load diff
60
libraries/FastLED/examples/FunkyClouds/funky.h
Normal file
60
libraries/FastLED/examples/FunkyClouds/funky.h
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
#pragma once
|
||||
|
||||
/*
|
||||
TODO:
|
||||
|
||||
example show oscis+p
|
||||
document caleidoscopes better
|
||||
write better caleidoscopes...
|
||||
improve and document emitters and oszillators
|
||||
explaining one example step by step:
|
||||
goal? what? how? why?
|
||||
gridmapping for rotation + zoom
|
||||
good interpolation for other matrix dimensions than 16*16
|
||||
more move & stream functions
|
||||
layers
|
||||
palettes
|
||||
link effects to areas
|
||||
1D examples
|
||||
2d example with more than 2 sines
|
||||
speed up MSGEQ7 readings
|
||||
|
||||
|
||||
DONE:
|
||||
25.6. creating basic structure
|
||||
setting up basic examples
|
||||
26.6. MSGEQ7 Support
|
||||
wrote more examples
|
||||
27.6. improved documentation
|
||||
added Move
|
||||
added AutoRun
|
||||
TODO list
|
||||
Copy
|
||||
29.6. rotate+mirror triangle
|
||||
more examples
|
||||
30.6. RenderCustomMatrix
|
||||
added more comments
|
||||
alpha version released
|
||||
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
Funky Clouds Compendium (alpha version)
|
||||
by Stefan Petrick
|
||||
|
||||
An ever growing list of examples, tools and toys
|
||||
for creating one- and twodimensional LED effects.
|
||||
|
||||
Dedicated to the users of the FastLED v2.1 library
|
||||
by Daniel Garcia and Mark Kriegsmann.
|
||||
|
||||
Provides basic and advanced helper functions.
|
||||
Contains many examples how to creatively combine them.
|
||||
|
||||
Tested @ATmega2560 (runs propably NOT on an Uno or
|
||||
anything else with less than 4kB RAM)
|
||||
*/
|
||||
|
||||
void InitFunky();
|
||||
void AutoRun();
|
||||
26
libraries/FastLED/examples/FunkyClouds/gfx.cpp
Normal file
26
libraries/FastLED/examples/FunkyClouds/gfx.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
#include "gfx.h"
|
||||
#include "FastLED.h"
|
||||
|
||||
// the rendering buffer (16*16)
|
||||
// do not touch
|
||||
CRGB leds[NUM_LEDS];
|
||||
XYMap xyMap = XYMap::constructRectangularGrid(CUSTOM_WIDTH, CUSTOM_HEIGHT);
|
||||
|
||||
void InitGraphics() {
|
||||
// set the brightness
|
||||
auto* controller = &FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds + 5, NUM_LEDS - 5);
|
||||
fl::ScreenMap screenMap = xyMap.toScreenMap();
|
||||
controller->setScreenMap(screenMap);
|
||||
// use this line only when using a custom size matrix
|
||||
// FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds2, CUSTOM_HEIGHT *
|
||||
// CUSTOM_WIDTH);
|
||||
FastLED.setBrightness(BRIGHTNESS);
|
||||
FastLED.setDither(0);
|
||||
}
|
||||
|
||||
void GraphicsShow() {
|
||||
// when using a matrix different than 16*16 use
|
||||
// RenderCustomMatrix();
|
||||
FastLED.show();
|
||||
}
|
||||
10
libraries/FastLED/examples/FunkyClouds/gfx.h
Normal file
10
libraries/FastLED/examples/FunkyClouds/gfx.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "defs.h"
|
||||
#include "crgb.h"
|
||||
|
||||
extern CRGB leds[NUM_LEDS];
|
||||
|
||||
void InitGraphics();
|
||||
void GraphicsShow();
|
||||
Loading…
Add table
Add a link
Reference in a new issue