BeginnerHelp,LED RainBow Switch With SoundSensor

Hi, Can you post us your circuit diagram please?
Just a pen(cil) and paper drawing will be fine with labels on components and pins.
Also make sure you include your power supply(s).

Do you have any control of your LEDs?
Have you got simple code that just controls the LEDS and nothing else?
JUST the LED control and none of the sound code.

Tom... :grinning: :+1: :australia:

There is circuit. enjoy :rofl: im very boring

This code work perfect to control single led.

const int ledpin=4;
const int soundpin=8;


volatile int state = LOW;
void setup() {
Serial.begin(9600);
pinMode(ledpin,OUTPUT);
pinMode(soundpin,INPUT);
}
void loop() {
int soundsens=digitalRead(soundpin);
{
  if(digitalRead(soundpin)==LOW)         
  {   
      //delay(10);
       if(digitalRead(soundpin)==LOW)
      {     
        while(digitalRead(soundpin)==LOW);
        delay(10);                     
        while(digitalRead(soundpin)==LOW);
        state = !state;
        digitalWrite(ledpin,state);
      }
   }
   ledState=digitalRead(ledpin);
   Serial.println(ledState);
}
}

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.