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

App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
App note: Noise analysis for high-speed op amps
App note: Noise analysis for high-speed op amps
Skill Sunday: Arrays
Skill Sunday: Arrays
App note: Infrared remote control implementation with MSP430FR4xx
App note: Infrared remote control implementation with MSP430FR4xx
Gesture Controlled Smart Home
Gesture Controlled Smart Home
Design for a Wideband, Differential Transimpedance DAC Output
Design for a Wideband, Differential Transimpedance DAC Output
Wrist thrusters let you fly through the water effortlessly
Wrist thrusters let you fly through the water effortlessly
Bertan/Spellman 225-20R HV power supply teardown
Bertan/Spellman 225-20R HV power supply teardown
Blinking Christmas Lights
Blinking Christmas Lights
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display
Adding an “extra sense” with rangefinders
Adding an “extra sense” with rangefinders
This wireless game controller looks like a rug
This wireless game controller looks like a rug
How to run your ESP8266 for years on a battery
How to run your ESP8266 for years on a battery
Calibration of a 3-Phase Energy Meter Board on the ADE7754
Calibration of a 3-Phase Energy Meter Board on the ADE7754
Making beats on a tiny Arduino DJ controller
Making beats on a tiny Arduino DJ controller
Qinsi-QS5100 Sn63Pb37 solder profile
Qinsi-QS5100 Sn63Pb37 solder profile
Water Detection System
Water Detection System
Professional Hi-Fi 15W Tube Amplifier circuit
Professional Hi-Fi 15W Tube Amplifier circuit
This Arduino machine will judge how sick your ollies are
This Arduino machine will judge how sick your ollies are
Turn an old payphone into a boombox for ’90s hits
Turn an old payphone into a boombox for ’90s hits

Top


Shares