It's time to make a brand new instrument! This instrument is inspired by the trumpet but is waaaaayyy cooler. Why? Because you can program it, and it has lights! How can we make an instrument with code and leds? I'm happy you asked! We're able to do all this because of an awesome electronics learning platform by Adafruit called the Circuit Playground Express! It has buttons, leds, a speaker, a tilting tracker (formally called an "accelerometer") and much more!
With your new instrument you'll be able change the pitch and volume by tilting the Circuit Playground Express in various directions. Pretty cool!
In this project you will learn:
- Beginner programming concepts with MakeCode.
- How to interact with hardware such as leds, an accelerometer, buttons, and a speaker.
- Some basic music theory.
- How to play a brand new instrument!
To play the Tilt Trumpet, you can hold it just like a Trumpet! Orient the Circuit Playground Express so that your index finger (left or right) lies on button A and your middle finger lies on button B as seen below.
You may hold the Tilt Trumpet how ever you like but this is the orientation I find most comfortable.
To start playing a tone, press either of the buttons. The closer button (A) will play a lower tone where as the farther button (B) will play a higher tone.
If you tilt the board away from you while holding either of the buttons, the pitch will increase. If tilted toward you, the pitch will decrease.
If tilted to the left the volume will increase.
If tilted to the right the volume will decrease.
What you'll need:
- Access to a computer (any operating system will do)
Testing it Out
If you'd like to try out the Tilt Trumpet for yourself before we dig into the programming, feel free to download the file below by simply clicking on the button. You should find a file entitled "circuitplayground-Tilt_Trumpet.uf2" in your downloads folder. Skip ahead to the section "Uploading Code" to find out how to upload the file to your Circuit Playground Express.
If you uploaded the file to your Circuit Playground Express, now try testing the Tilt Trumpet out by holding each button down and tilting the board around. Pretty cool right? How does it all work? And how does the board know how to change pitches and NeoPixel colors? We'll dive into all that right away.
Let's get started!