This repository holds the Arduino program featured in the SparkFun tutorial on creating a music visualizer with a strip of addressable RGB LEDs.
The wish list for all these parts can be found here.
The resistor and capacitor are not required, but they will help prevent possible damage to the LEDs.
This project requires virtually no soldering! The few exceptions will probably be soldering some pins to the sound detector, and if you've cut a roll of addressable LEDs in the middle you'll have to solder some wires to the starting LED's pins. If you've never soldered before, I highly suggest taking a look at this guide.
Below is also a general chart for how the pin(s) on each component should be routed, and an accompanying diagram. But before you begin, here are some things to keep in mind:
The pins used in the diagram and the code are in parentheses. If you use a different pin, don't forget to change it in the code as well:
Between ground and 5VSound Detector | Addressable LED strip | Trimpot | Pushbutton | 1 mF (1000 µF) Capacitor | 300–500 Ω Resistor |
---|---|---|---|---|---|
Envelope → Analog (A0) | Digital/Analog (A5) → Resistor → DIN | 5V → left or right pin | GND → Either side | Between Digital/Analog (A5) and DIN on LED strip | |
3.3V → VCC | 5V → 5V | Middle pin → Analog (A1) | Other side → Digital (4, 5, 6) | ||
GND → GND | GND → GND | Remaining left or right pin → GND |
Sound Detector Notes: The microphone used is not a sophisticated, logarithmic sound receiver like your ear; it is only measuring compressional waves in the air. Consequently, the microphone is more likely to detect and/or prioritize lower-frequency sounds since they require more energy to propagate, and therefore oscillate the air more intensely. Also, a resistor can be placed in the "GAIN" slots to modify the gain. Standard gain should be sufficient for our purposes, but for more info check here.
**Diagram of a possible circuit:** Things to remember before you compile:
knob
in the code (ctrl+F will come in handy for that). Otherwise, the program will think you still have a potentiometer that is set to a very low value (i.e. everything will be very dim).bool shuffle = false;
to bool shuffle = true;
. The code should compile and run properly, but for good practice you should remove all blocks the code says to delete since they reference the BUTTON
constants.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。