Passive buzzer
No oscillator: it only plays when given a wave. The tone is the frequency of the PWM you generate, so you can play notes and songs.
Pinout
| Pin | Connect to | Note |
|---|---|---|
| + | GPIO (PWM) | |
| − | GND |
FastTeacherFor teachers
From the syllabus to a planned semester
- Teaching plan and calendar built automatically
- Class diary ready to paste into SIGA
- Slides and exercise lists with answer keys
Free Community edition · Windows
MicroPython example
from machine import Pin, PWM
import time
buzzer = PWM(Pin(5), freq=440, duty_u16=32768) # A (440 Hz)
time.sleep(0.5)
buzzer.deinit()
Specifications
| Item | Value | Source |
|---|---|---|
| Tone | equal to the PWM frequency | Typical datasheet values |
Values marked "Under review" will still be checked against the parts in the lab.