Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

Here’s how to play the Star Wars song with electronics

Here’s how to play the Star Wars song with electronics

Today is the last day.

I’m teaching a course at betahaus in Berlin.

And tonight is our last session.

It’s also my last day in Berlin (for now) — but more on that some other time.

We’ve had a lot of fun in the course.

One thing I taught was how to play a melody using an Arduino.

…and I thought that might be interesting for you too.

(If you don’t know what Arduino is, you can learn about it here: http://www.build-electronic-circuits.com/what-is-arduino/ )

Here’s how to create a melody player:

In the last session, they (the students) learned to play a tone with a piezo speaker, using the tone() function.

By combining many tone() commands, you can create a melody.

Just find the notes of the song you want to play (easy to do with Google).

There’s also a function called noTone() to stop the tone from being played. By combining these two functions with the delay() function, you can play melodies.

Here’s an example:
http://youtu.be/cye_wiaqybk

The tone function needs the frequency of the note you want to play. To find the frequencies of musical notes, you can check out the table on this page:
http://www.intmath.com/trigonometric-graphs/music.php

If you have an Arduino and a piezo speaker, I would highly recommend you to try it out. It’s a fun exercise, and it gives you something cool to show off to your friends.

No idea what Arduino is, or how to get started?

I have a guide — “Get started with Arduino in less than a day” — that you’ll receive as a bonus if you get one of my eBook bundles here:

http://www.build-electronic-circuits.com/products/ebook-2nd-edition/

Keep on Soldering!
Oyvind

PS! It’s soon time to launch the next round of my online course. I just need to finish some of my projects before taking on something new. I’ll keep you posted.

Copyright Build Electronic Circuits

Read more Here

 

More Articles to Read

#FreePCB via Twitter to 2 random RTs
#FreePCB via Twitter to 2 random RTs
Estimating Power for ADSP-BF561 Blackfin® Processors
Estimating Power for ADSP-BF561 Blackfin® Processors
Teach Your Arduino to Switch Itself Off!
Teach Your Arduino to Switch Itself Off!
Control a tracked robot with your mind (or joystick)
Control a tracked robot with your mind (or joystick)
A 400W (1kW Peak) 100A electronic load using linear MOSFETs
A 400W (1kW Peak) 100A electronic load using linear MOSFETs
Shirt Pocket Transceiver with the Si5351 and OLED
Shirt Pocket Transceiver with the Si5351 and OLED
All metal C930e webcam
All metal C930e webcam
The Soldering Tools That Make Your Life Easier
The Soldering Tools That Make Your Life Easier
App note: Operation evaluation of ultra low ON resistance MOSFET supporting quick charge for 1 c ...
App note: Operation evaluation of ultra low ON resistance MOSFET supporting quick charge for 1 cell Lithium ion battery protection
Synthesized Sidetone
Synthesized Sidetone

Top




Shares