Help with an arduino code

Hey Arduino community fellows!! Need some Help if you would!! First of all I would like to apologized for for my poor English grammar, my native language is spanish…
Anyway I’m just learning the basics with arduino code and also I’m making my first steps with the physical arduino parts and I’m trying to make my first project but I’m already running into some little programming and hardware problems!! let me try explain what is going on!!
I have built a simple 6 led knight rider car lights “Which I intend to use it in my truck” and I want to go one step further with this project
I want to add a sound sensor so when the circuit sense a noise, automatically lit the led lights for 5 minutes and then off until a new noise is detected!! Sort of a car alarm light but with the knight rider cool touch…
Need help connecting the sound sensor to the arduino board and with the 6 leds project that I already have built
I connected on my arduino mega board the pins 4 to 9 and then to the six 390 ohm resistors and to each of the 6 leds
I got this code also with the first original setup but I don’t know how to combine this code with the new code which first of all make the sound sensor works and then triggers the led lights ON, for five minutes and then OFF again until a new noise is detected!!
I’m uploading some attachments so you know what is going on and if you want to help me out!!
Muchas Gracias!!!
latter on I want to be able to add a camera to the same boar to start recording when the noise sensor is triggered

arduino knight lights.txt (1.27 KB)

auto_fantastico.ino (1.2 KB)

Need help connecting the sound sensor to the arduino board

When I have an unknown sensor to attach, I do one of two things.

  1. google the sensor to see how to connect it
  2. duct tape it on and hope that something magic happens.

I usually find that 1 is more effective.