Giter VIP home page Giter VIP logo

-pirates-of-the-caribbean-theme-song's Introduction

Play "Pirates of the Caribbean" Theme Song on Arduino and Buzzer ๐ŸŽต

This file contains the code to play the "Pirates of the Caribbean" Theme Song on a Arduino via a Buzzer

Youtube in action: https://www.youtube.com/watch?v=sjPAj1lXgtk

๐Ÿ’ป Local testing

  1. Download Pirates_of_the_Caribbean_-_Theme_Song.ino

  2. Connect Pin 10 of the Arduino to the positive side of a buzzer or a microphone

  3. Connect any resistor (220 ohms for example) to the negative side of a buzzer and to the ground pin of the Arduino

  4. Upload the sketch and enjoy!

๐Ÿ˜Ž Virtual testing

Don't have an Arduino with you right now? No worry. You can test it virtually on my simulated TinkerCAD circuit.

  1. Click Simulate

  2. Click Start Simulation and enjoy!

๐Ÿ“– Learn more

Want to learn more about the science behind sound, buzzer, Arduino tone library? Check out my learning note on TipStory where I share a step by step walkthrough of the science and how I made this. I would appreciate a helpful upvote and an interesting upvote from you on TipStory.

๐Ÿš€Happy engineering and designing!


This project was first created in 2016. It is recently updated on 2021.03.25, 5 years later. I know, sorry, I lost track of it, lol. There are a couple of improvements that can be made and have been made with this update:

  1. You can remove the paper seal on the buzzer to make it sound better (Thanks Ricardo Moreno for the suggestion)

  2. songSpeed and wait are converted to float type (Thanks Andrew Lalis for catching the bug)

  3. noTone is used to handle malperformance of some Arduinos (Thanks Anthony Pelletier for bringing up this issue)

  4. In my previous comment, I said you can only use PWM pins for the buzzer. That is not true and has been corrected. You can use any digital pin pin 0-13. The tone library uses a hardware timer and a timer interrupt to generate a square wave with different frequency, so it works on any digital pin. Beware that this might interfere with PWM when you use analogWrite because PWM also uses a timer.

  5. Better coding style, format, variable names... (I have learned a lot more about coding since I first exposed to C++ 5 years ago)

-pirates-of-the-caribbean-theme-song's People

Contributors

xitangg avatar xitanggg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.