Components and supplies
Arduino UNO
Speaker: 0.25W, 8 ohms
Project description
Code
Volume Library
The Volume library is also available through the Arduino Library Manager!
Downloadable files
Hookup Guide
Hookup Guide
Hookup Guide
Hookup Guide
Comments
Only logged in users can leave comments
DaveX
3 years ago
Neat trick. On the Arduino Mega, with its ATMega2560, there's an Output Compare Modulator OCM1C0A system that modulates between timer0 and timer1 like this so you could do it in hardware rather than software. The ATMEGA2560's OCM1C0A system modulates output on the PB7/OC0A/OC1C pin (Arduino Mega digital pin 13) using the OCR0A and OCR1C registers.
Anonymous user
5 years ago
Hello, I am using an 8 ohm , 3W speaker connected between pin 5 & ground and am not seeing much of a difference in volume as compared to a simple output raised high with a 120ohm resistor in series with the speaker. I initialize using the following in setup: vol.begin(); vol.setMasterVolume(1.00); An in the loop I make the following call: vol.tone(tempvalue,255); Where tempvalue is a number from 100 to 6000. Any ideas where I went wrong?
connornishijima
0 Followers
•0 Projects
8
3
Anonymous user
2 years ago
Hello, I am using an 8 ohm , 3W speaker connected between pin 5 & ground and am not seeing much of a difference in volume as compared to a simple output raised high with a 120ohm resistor in series with the speaker. I initialize using the following in setup: vol.begin(); vol.setMasterVolume(1.00); An in the loop I make the following call: vol.tone(tempvalue,255); Where tempvalue is a number from 100 to 6000. Any ideas where I went wrong?