From 5f14088b3877d71122449d0b5d643f40751bf3d0 Mon Sep 17 00:00:00 2001 From: Phillip Burgess Date: Fri, 1 Oct 2021 13:56:32 -0700 Subject: [PATCH] Googly Eyes: adjust constants, Audio Spectrum: add comment re FFT library --- EyeLights_Audio_Spectrum/EyeLights_Audio_Spectrum.ino | 1 + EyeLights_Googly_Rings/EyeLights_Googly_Rings.ino | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/EyeLights_Audio_Spectrum/EyeLights_Audio_Spectrum.ino b/EyeLights_Audio_Spectrum/EyeLights_Audio_Spectrum.ino index 5299dd3b0..1d45be5b4 100644 --- a/EyeLights_Audio_Spectrum/EyeLights_Audio_Spectrum.ino +++ b/EyeLights_Audio_Spectrum/EyeLights_Audio_Spectrum.ino @@ -1,6 +1,7 @@ /* AUDIO SPECTRUM LIGHT SHOW for Adafruit EyeLights (LED Glasses + Driver). Uses onboard microphone and a lot of math to react to music. +REQUIRES Adafruit_ZeroFFT LIBRARY, install via Arduino Library manager. */ #include // For LED driver diff --git a/EyeLights_Googly_Rings/EyeLights_Googly_Rings.ino b/EyeLights_Googly_Rings/EyeLights_Googly_Rings.ino index b1df593cd..9e626a695 100644 --- a/EyeLights_Googly_Rings/EyeLights_Googly_Rings.ino +++ b/EyeLights_Googly_Rings/EyeLights_Googly_Rings.ino @@ -23,7 +23,7 @@ public: // so rings don't spin in perfect lockstep. angle = random(1000); momentum = 0.0; - friction = 0.9 + random(500) * 0.0001; // Inverse friction, really + friction = 0.94 + random(300) * 0.0001; // Inverse friction, really } // Given a pixel index (0-23) and a scaling factor (0.0-1.0), @@ -41,9 +41,9 @@ public: // physics simulation and render the corresponding LED ring. void iterate(sensors_event_t &event) { // Minus here is because LED pixel indices run clockwise vs. trigwise. - // 0.004 is just an empirically-derived scaling fudge factor that looks + // 0.006 is just an empirically-derived scaling fudge factor that looks // good; smaller values for more sluggish rings, higher = more twitch. - momentum = momentum * friction - 0.004 * + momentum = momentum * friction - 0.006 * (cos(angle) * event.acceleration.z + sin(angle) * event.acceleration.x); angle += momentum;