Piezo

How far did you get with this?

...Nobody can write the program for you because we don't know where/how the piezos or LEDs are connected, or how much signal you're getting out of the piezo, etc. Plus, this a DIY forum for people who want to learn and do things themselves.

...You're going to have to make an outline of what your code should do.

You'll need [u]If-statements[/u] because if something happens you want to turn on an LED, etc.

You may also need two (or more) [u]loops[/u], so when you're done with the 1st loop, you can move-on to the next one and wait for the 2nd piezo trigger, etc. (There are 3 kinds of loops in addition to the main loop.)

Take it one step at a time and "develop" your code, testing as you go-along.... Sometimes you'll have to add some extra code just for testing, such as some print statements so you can "see" what your program is doing before you're done, etc. Do NOT try to write the whole program at once!

Then, when if you run into a problem that you can't figure out, post your code and maybe someone can help you.

You might want to start with the Analog Read Serial Example to see what you're getting from the piezo and if you're getting 5V (1023 on the analog) you may be able to read it digitally. (And, you might want to take the delay out of the Analog Read Serial Example because you want the best chance of "catching" the peaks.)

It may turn-out that you need to use interrupts, but let's not worry about that yet.