Hey guys i was wondering if its possible make my LED’s (image below) on my board to flash according to any sound such as music. And maybe not just flash altogether but different LED’s to flash like a visualizer instead of all at once. So if anyone could help me code and tell me what i need to do it would be appreciated.
Also i’m not 100% sure which component i need to do this, i have two of these and i’m pretty sure its supposed to be these but if someone could confirm it would be very helpful.
Current Board:
Current Code, Audio sensors not implemented. It just uses the Potentiometer to control the blink speed of the LED’s.
int sensorPin = A5; // select the input pin for the potentiometer
int ledPins={ //Create array for Led pin values
7,8,9,10,11}; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
for (int i=0; i < 5; i++) //For all LEDs in the array
pinMode(ledPins*, OUTPUT);* } void loop() {
// read the value from the sensor:*
sensorValue = analogRead(sensorPin);*
// turn the ledPin on*
for (int i=0; i < 5; i++)*
_ digitalWrite(ledPins*, HIGH);_
_ // stop the program for milliseconds:_
_ delay(sensorValue);_
_ // turn the ledPin off:_
_ for (int i=0; i < 5; i++)_ _ digitalWrite(ledPins, LOW); // stop the program for for milliseconds: delay(sensorValue); }[/quote]*_
Well there is no amplifier so that is why it is not working. Also the microphone seems to be plugged straight into the analogue input which again is not the way it is done.