File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
22AUDIO SPECTRUM LIGHT SHOW for Adafruit EyeLights (LED Glasses + Driver).
33Uses onboard microphone and a lot of math to react to music.
4+ REQUIRES Adafruit_ZeroFFT LIBRARY, install via Arduino Library manager.
45*/
56
67#include < Adafruit_IS31FL3741.h> // For LED driver
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public:
2323 // so rings don't spin in perfect lockstep.
2424 angle = random (1000 );
2525 momentum = 0.0 ;
26- friction = 0.9 + random (500 ) * 0.0001 ; // Inverse friction, really
26+ friction = 0.94 + random (300 ) * 0.0001 ; // Inverse friction, really
2727 }
2828
2929 // Given a pixel index (0-23) and a scaling factor (0.0-1.0),
@@ -41,9 +41,9 @@ public:
4141 // physics simulation and render the corresponding LED ring.
4242 void iterate(sensors_event_t &event) {
4343 // Minus here is because LED pixel indices run clockwise vs. trigwise.
44- // 0.004 is just an empirically-derived scaling fudge factor that looks
44+ // 0.006 is just an empirically-derived scaling fudge factor that looks
4545 // good; smaller values for more sluggish rings, higher = more twitch.
46- momentum = momentum * friction - 0.004 *
46+ momentum = momentum * friction - 0.006 *
4747 (cos (angle) * event.acceleration .z +
4848 sin (angle) * event.acceleration .x );
4949 angle += momentum;
You can’t perform that action at this time.
0 commit comments