How to make the buzzer sound loud with a long tone on PicoBricks?
I'm new to Pico and I was trying to make some simple projects with it. I received it today. I could manage to make the leds blink when pressed so that project was fine.
But now I'm trying to use the buzzer on my PicoBricks. It's working but I'm just hearing a click sound as soon as I press the button and after that nothing really. Only when I press the button again it makes the click sound again. How can I make it sound louder with a long tone when I keep the button pressed?
The code I'm using is here:
from machine import Pin
buzzer = Pin(20, Pin.OUT)
button = Pin(10, Pin.IN, Pin.PULL_DOWN)
if button.value() == 1:
I don't know if you want to try MicroBlocks.
In MicroBlocks you have a library for playing notes called Tone 😁
You can easily set the amount of time the note has to play.0
A buzzer creates a tone by vibrating at a certain frequency. So instead of pulling the Pin you have to use PWM and modulate the buzzer with the frequency and duty cycle you want https://micropython-workshop.readthedocs.io/en/latest/pages/shields/buzzer.html0
- 96 All Categories
- 3 Community
- 3 Hello Maker!
- 83 PicoBricks - Make, Run, Split, Merge
- 26 Hardware Support
- 14 PicoBricks Backers Hub
- 41 MicroBlocks Support
- 2 Shipping Support
- 10 Products & Technology
- Raspberry Pi
- 10 Other