:mod:`buzzer` -- buzzer control module ====================================== .. module:: buzzer :synopsis: control the buzzer. The actual name of the module can be ``buzz_wgen`` or ``buzz_nogen`` depending on the type of the buzzer installed. It is **not** recommended to create an instance of this class manually. An instance has already been created in the [RFID Utils](#mod_rfid_utils) module. It can be imported with the following snippet:: try: from rfid_utils import BUZZ except Exception: print('Sorry, no buzzer on this board') Classes ------- .. class:: Buzzer(pin) ``pin`` is the number of the GPIO with the buzzer. .. method:: on() Switch the buzzer on. The ``buzz_nogen`` module provides an optional parameter ``freq`` with the default value of 3200 .. method:: off() Switch the buzzer off. .. method:: beeps(time_ms=50) Switch the buzzer on for the ``time_ms`` period (in milliseconds). This is not a coroutine (blocks for ``time_ms`` milliseconds). .. method:: beep(time_ms=50) :async: Switch the buzzer on for the ``time_ms`` period (in milliseconds). This is a coroutine. .. py:property:: enabled Returns ``True`` if the buzzer is currently on, ``False`` if it is off.