N00bie needing urgent help!  PLSKTHX!  ^

Hey all, I’m an uber n00b to Arduino. I’ve been learning and using it for my physical computing class, and now I’m kinda stuck. Actually really stuck! (Please be kind if this all seems really simple and I’m dumb haha.) But I’m trying to program my arduino to play a melody and active two red LEDS with the activation of a button. The big project I’m working on is hacking a stuffed toy and making it react to your interaction by giving a response you wouldn’t expect.

But yeah… I’ve tried combining different sketches and I’m failing horribly. Plus I might be setting up the skematic wrong for the peizo and my two red LEDs… Hahaha any guidance at all would be most appreciated! And again I apologize for being a n00b.

~Starstorm

hey

as a start, you have to post the code that you have!

D

If you want help, please take the time to respect the members of this forum and don’t post in kiddiespeak.

As Daniel says, post your code, and if you think your circuit is wired wrong, post a diagram or schematic of what you are doing.

Sorry for the “kiddie” speak, I only used it to break the ice. :-/

Anyway… I don’t have much of a code. I just need something that connects my button to pin 2, when pin 2 is HIGH activate 5V and activate pin 13. I’ve tried combining the sketch play melody with the basic button sketch and I get nothing.

Everything else is fine, it’s just coming up with a working sketch that’s been extremely difficult.

What do you have on pin 13? Simply making it high will not play a melody on a speaker or piezo element, but could work if what you have there is a music generator.

I’m not clear what you mean then by activate pin 13, just set it or output a waveform to play a melody?

How are you connecting the button to pin 2?

I just need something that connects my button to pin 2, when pin 2 is HIGH activate 5V and activate pin 13. I’ve tried combining the sketch play melody with the basic button sketch and I get nothing.

Everything else is fine, it’s just coming up with a working sketch that’s been extremely difficult.

Why not start with the simpler ‘hello world’ sound sketch here http://www.uchobby.com/index.php/2007/11/14/arduino-sound-part-2-hello-world/

It may be easier for you to see how to get this working with your button and leds before moving on to the more complex melody sketch. And if you have trouble getting that going, it will be easier to help you fix your sketch if you post it here with an explanation of what is and is not working.