pyupm_buzzer module¶
-
class
pyupm_buzzer.
Buzzer
(pinNumber)[source]¶ Bases:
object
API for the Buzzer component.
ID: buzzer
Name: Buzzer
Category: sound
Manufacturer: seeed
Connection: pwm
Kit: gsk This module defines the Buzzer interface for libbuzzer. This sensor can make different tones when connected to a pin capable of analog pulse-width modulation. It emits sound using a piezoelectric material that vibrates at different frequencies based on the input voltage.
C++ includes: buzzer.hpp
-
playSound
(note, delay)[source]¶ int playSound(int note, int delay)
Plays a tone for a certain amount of time or indefinitely. When delay is not used, the sound can be stopped by calling stopSound().
note: Note to play (DO, RE, MI, etc.) or frequency
delay: Time in microseconds for which to play the sound; if the value is 0, the sound is played indefinitely
Note played
-