Your shopping cart is empty!
Make Some Noise!
- Ahmad Noqman Arif Muzafar
- 28 Feb 2024
- Tutorial
- Beginner
- 238
This guide will show you how to program the buzzer on your Maker Uno RP2040 to play melody or tone. The on-board buzzer is connected to GP8.
1. While the Maker Uno RP2040 is connected to your computer, open your editor software (for example Thonny). Select the code.py file in your drive.
2. Copy and paste the following code to your editor.
3. Flash the codes to your Maker Uno RP2040. The expected outcome is that the on-board buzzer will play a melody on startup and then play short tones when the on-board button is pressed.
Library file(s) required:
simpleio.mpy
If you don't have this file in your computer, download the lib bundle here and search for this file inside the "lib" folder.
4. You may also try flash this following code to your Maker Uno RP2040. Similar to the previous code, this code will program the on-board buzzer to play a melody. However, this time, you can control the volume and a "notes map" is created to give you the flexibility to explore. Feel free to swap out the notes with your favorite ones to play your melody of choice!