Arduino How To: Blink + Buzz Project

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,152
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 8, 2009

A program i copied mostly. You'll need, an arduino board, piezo buzzer, led, arduino software. You might need, breadboard, jumper wires. Put the negatives pins of the buzzer and led into the ground pin, and put the positives where ever you want (but make sure to edit the code). I put mine at pin 13 and 52, because I have the ARDUINO MEGA! Here is the code and it will work if you change the pin numbers to where you have your buzzer and led! and also put a less than sign where i say to put one! it should work then. just copy and paste:

void setup() {
pinMode(11, OUTPUT); //make sure to change the pin number based on your setup
pinMode(52, OUTPUT);
}
void loop() {
buzz(11, 600, 500); //600 is the pitch, 300 is very low, 2000 is very high and 500 is the time, 1000 is a second
digitalWrite(52, LOW); //change pin numbers if necessary
delay(1000); // time inbetween flashes/buzzes
digitalWrite(52, HIGH);
}
void buzz(int targetPin, long frequency, long length) { //this is a bunch of crap i didn't understand
long delayValue = 1000000/frequency/2;
long numCycles = frequency * length/ 1000;
for (long i=0; i ((((****PUT A LESS THAN SYMBOL IS PLACE OF THIS))) numCycles; i++){ digitalWrite(targetPin,HIGH); delayMicroseconds(delayValue); digitalWrite(targetPin,LOW); delayMicroseconds(delayValue);
}
}

Category:

Entertainment

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (buggyiscool)

  • Cool, looks like you have got the hang of it super quick.

  • lol yea i got it really quickly but this is just a super simple not impressive thing. i just received more buttons, M/M wires, led matrix(!!!!), a blackberry trackball, and a bigger breadboard! so i can make way better stuff, thanks again for sparking my interest in this!

  • what is it used for? seems kinda pointless, and what does it do?

  • anything you want it to do. this is just the tip of the iceberg. not even

  • WTF?

  • dude you gotta get this. i love it...its a open source micro controller...you program it with C...its amazing

see all

All Comments (6)

Sign In or Sign Up now to post a comment!
  • yea all the parts i bought including the board cost $90! and i looked up a bunch more stuff i would want and thats $90 together too!

  • yeah cool I wouldn't mind getting a RGB led matrix and a serial LCD. leds only do so much for feedback. manthere is so many parts to buy for Arduino I would be broke in no time lol.

  • i ordered my wires literally 30 minutes after the board and the wires havent come yet! yea i need resistors too. and im ordering a RGB LED matrix and that will be awesome!

  • Cool project and funny enclosure but you really should put a resistor in between the arduino and led for protection. The arduino Mega is nice but if you burn it out you cant just swap the chip out like the Duemilanove. I have both boards and i use the regular one for debugging stuff I never worked with before because it only costs like 4 bucks for a replacement chip =)

    I cant wait to see what you build next the Mega really has some cohonas!

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more