Music Visualizer
Dependencies: mbed SDFileSystem NeoStrip PinDetect
Diff: main.cpp
- Revision:
- 9:0e16d1e33c4b
- Parent:
- 8:fa37292cf52c
--- a/main.cpp Thu Apr 30 02:46:26 2020 +0000 +++ b/main.cpp Thu Apr 30 04:00:33 2020 +0000 @@ -12,7 +12,6 @@ #define N 40 NeoStrip strip(p21, N); -//BusOut myleds(LED1,LED2,LED3,LED4); DigitalOut myled(LED1); DigitalIn b2(p29, PullUp); @@ -129,16 +128,6 @@ strip.setPixel(i + 16, 0x000000); strip.setPixel(i + 24, 0x000000); strip.setPixel(i + 32, 0x000000); - - // old setup for 5 rows of 8 LEDs - //strip.setPixel(i + i * 7, 0x000000); -// strip.setPixel(i + 1 + i * 7, 0x000000); -// strip.setPixel(i + 2 + i * 7, 0x000000); -// strip.setPixel(i + 3 + i * 7, 0x000000); -// strip.setPixel(i + 4 + i * 7, 0x000000); -// strip.setPixel(i + 5 + i * 7, 0x000000); -// strip.setPixel(i + 6 + i * 7, 0x000000); -// strip.setPixel(i + 7 + i * 7, 0x000000); } x += 1; if (x > 360) @@ -194,8 +183,6 @@ Thread::yield(); } - - unsigned short max_range = 0xFFFF; // function that calls above functions void patternSound(){ @@ -235,16 +222,12 @@ micvalue == buffer[4] && micvalue == buffer[5] && micvalue == buffer[6] && micvalue == buffer[7] && micvalue == buffer[8] && micvalue == buffer[9]){ centervalue = buffer[1]; - //pc.printf("-%d-", centervalue); } } int offset = micvalue-centervalue; - //pc.printf(" %d ", offset); - //myleds = micvalue; mic2LED(2+offset); wait(1.0/4000.0); } - //////////////////////////////////////////////////////// strip.write(); Thread::wait(10); }