So my problem is that for a project I am working on I want to be able to control the “loudness” of my Piezo Buzzer with a potentiometer. I tried doing this both in the code and trying to route the potentiometer through the GND line for the piezo. I am using the pitches.h library for my notes to play music. I am using a Mega 2560 board for this.
Note: All of my code has been taken and modified from the SIK Guidebook (SparkFun Inventors Kit)
Note 2: Please use very simple terms I am very new to this.
Note 3: If you need any extra information then feel free to ask.
Piezo_Element.ino (776 Bytes)
pitches.h (1.95 KB)