5.6.C - Potentiometer Piezo Delay
Explore how we can make sounds using a piezo speaker with a potentiometer.
Next
Same Circuit – Make sure connections work
Back
Next
Load the Code (1 of 2)
We're going to load the following code for our Potentiometer Piezo Delay program
We'll use the random function to choose a numerical value (between 131 and 988) and then play that tone and pause before choosing a new tone to play.
Back
Next
Load the Code (2 of 2)
We're going to load the following code for our Potentiometer Piezo Delay program
The Potentiometer will set a delay between 0 and 512 (about half a second) by mapping the input, which will be between 0 and 1024.
Back
Next
Test it Out!
Once the code is loaded it should start running immediately.
The Piezo will create a different tone (randomly selected) and will change after a certain amount of time, as determined by the position of the Potentiometer.
Back
Next
Back
5.6.C - Potentiometer Piezo Delay
Teaching and Learning
Created on May 20, 2026
Start designing with a free template
Discover more than 1500 professional designs like these:
View
Essential Business Proposal
View
Project Roadmap Timeline
View
Step-by-Step Timeline: How to Develop an Idea
View
Artificial Intelligence History Timeline
View
Word Search: Corporate Culture
View
Match the Verbs in Spanish: Present and Past
View
Process Flow: Corporate Recruitment
Explore all templates
Transcript
5.6.C - Potentiometer Piezo Delay
Explore how we can make sounds using a piezo speaker with a potentiometer.
Next
Same Circuit – Make sure connections work
Back
Next
Load the Code (1 of 2)
We're going to load the following code for our Potentiometer Piezo Delay program
We'll use the random function to choose a numerical value (between 131 and 988) and then play that tone and pause before choosing a new tone to play.
Back
Next
Load the Code (2 of 2)
We're going to load the following code for our Potentiometer Piezo Delay program
The Potentiometer will set a delay between 0 and 512 (about half a second) by mapping the input, which will be between 0 and 1024.
Back
Next
Test it Out!
Once the code is loaded it should start running immediately.
The Piezo will create a different tone (randomly selected) and will change after a certain amount of time, as determined by the position of the Potentiometer.
Back
Next
Back