Skip to content

NinjasCL/rpitune

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi Music Tunes with RTTTL

This is a simple project for sending Nokia’s RTTTL (RingTone Text Transfer Language) to a buzzer in a Raspberry Pi.

This code will compile a single binary that will send the frequencies to the buzzer.

Hardware

  • Raspberry Pi Model B

  • Passive Buzzer 5v. (Computer Speaker)

  • Cables.

It’s important that your buzzer is a passive one, if it beeps when you feed it with 3.3V then it is not a passive one and this project will not work properly.

Deps

First must install the dev packages:

$ sudo apt -y install gcc g++ make automake git

Then install WiringPi dev files:

$ git clone https://github.com/WiringPi/WiringPi.git
$ cd WiringPi
$ ./build

Make sure to add your user to the gpio group.

$ sudo usermod -aG gpio <username>

Schematics

You can connect the buzzer to the GPIO 4 (positive) and the other to the ground. Or change it in pin.h.

https://www.circuitbasics.com/how-to-use-buzzers-with-raspberry-pi/

Song

You can select a song in song.h. There is a bunch of sample songs too inside docs/songs. (Got from https://picaxe.com/rtttl-ringtones-for-tune-command/). This song will play if you do not give any arguments to the program.

Compilation

Once you configured your PIN and SONG you can compile with:

$ make build

It will generate a new binary named tune. This binary can be executed and will play the SONG. Maybe can be used on login? or startup sound?.

A binary is included in this repo if you want to avoid compilation.

Play

Now you can play using the command ./tune.

Example:

$ cat docs/songs/mix1/adams.txt | xargs ./tune

LICENSE

BSD 2-Clause License

Credits

Made with ♥ by Ninjas.cl.

About

🎹 Rasperry Pi Buzzer Tunes with RTTTL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published