Introduction
Connect a piezo speaker to a Bit Board and control it with code.
We'll explore how we can make sounds using a piezo speaker.
Video Overview
Featured Document
-
-
We'll use Maker Tape to connect the Piezo to the Bit Board on a LEGO baseplate.
-
The Piezo will connect to Pin 8 and to Ground (GND).
-
You'll notice the Ground on the Bit Board (as well as the Piezo and other Crazy Circuits components we'll use) is color coded White.
-
-
-
If you've never used a micro:bit before you'll want to check out this guide: Bit Board V2 Setup and Use
-
We're going to load the following code for our Piezo CC program: https://makecode.microbit.org/_0saiRVWVD...
-
The micro:bit (since the release of version V2) has included a built-in piezo speaker on the back. This guide will show you how to use the Crazy Circuits Piezo specifically. We'll cover choosing between the two piezos in the next guide.
-
It may be worth taking a quick look at the set Audio Pin page for more in-depth information.
-
If you want to edit the code and explore a bit, check out the options for the play block: until done, in background, and looping in background.
-
-
-
Once the code is loaded it should start running immediately.
-
You can power the micro:bit via the USB cable you used to load the code or you can use a battery pack plugged into the Bit Board.
-
The micro:bit will play a sound, wait one second, then play it again, and repeat.
-
-
-
Follow along with our recorded Live Stream!
-
You can watch the full video of us walking through this project, along with explaining and exploring the code: https://www.youtube.com/live/3olw8CrFukM...
-
