Skip to content

Commit 6fddfc9

Browse files
formatting
1 parent b28f926 commit 6fddfc9

File tree

3 files changed

+117
-115
lines changed

3 files changed

+117
-115
lines changed

examples/16x16-matrix/plasma-16x16-cprg/plasma-16x16-cprg.ino

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
/*
1+
/*
22
* Plasma
3-
*
3+
*
44
* This is a demonstration of the plasma algorithm displayed on an RGB LED matrix. `
55
* The COLOR_SCHEME global variable allows you to easily change between some pre-made
66
* color schemes. Using the patterm of the demonstration color schemes, it should be
77
* easy to add others.
8-
*
8+
*
99
* The algorithm for this demo was sourced from here:
10-
*
10+
*
1111
* https://www.bidouille.org/prog/plasma
12-
*
12+
*
1313
*/
14+
#include <Adafruit_I2CDevice.h>
1415
#include <RGBLEDMatrix.h>
1516
#include <RGBColor.h>
1617

1718
/* Color Schemes
18-
*
19+
*
1920
* 1 - Full rainbow gradients in RGB
2021
* 2 - Red, Orange, white gradients
2122
* 3 - gray scale
22-
*
23+
*
2324
*/
2425
const int COLOR_SCHEME = 1;
2526

@@ -34,7 +35,7 @@ int mapSineToRange( float sineValue, int rangeMax ) {
3435
}
3536
void drawPlasma( unsigned long counter ) {
3637
float utime = float(counter)/TIME_DILATION;
37-
38+
3839
leds.startDrawing();
3940
for (unsigned int col = 0; col < leds.columns(); col++ ) {
4041
float x = ((float)col/((float)leds.columns()*HORIZ_SPACE_STRETCH_FACTOR)) - 0.5;
@@ -44,11 +45,11 @@ void drawPlasma( unsigned long counter ) {
4445

4546
float v1 = sinf(x*10.0+utime);
4647
float v2 = sinf(10.0*(x*sinf(utime/2.0) + y*cosf(utime/3.0)) + utime);
47-
48+
4849
float cx = x + 0.5*sinf(utime/5.0);
4950
float cy = y + 0.5*cosf(utime/3.0);
5051
float v3 = sinf( sqrtf(100.0*(cx*cx + cy*cy) + 1.0) + utime );
51-
52+
5253
float v = v1+v2+v3;
5354

5455
int r, g, b;

0 commit comments

Comments
 (0)