Difference: BuzzerShield (2 vs. 3)

Revision 32019-05-17 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WeMosD1Mini"

The Buzzer shield

The Hardware

Changed:
<
<
The buzzer shield implements a passive buzzer with frequencies up to 1 kHz - 3 kHz. By default it uses data line D5 corresponding to GPIO 14 but can be configured to a different GPIO line.
>
>
The buzzer shield implements a passive buzzer with frequencies up to 1 kHz - 3 kHz. By default it uses data line D5 corresponding to GPIO 14 (GPIUO 18 on the ESP32) but can be configured to a different GPIO line.
  wemosBuzzer.png
Line: 20 to 20
  And here are the scripts playing the ringtones: esp8266Buzzer is the main program relying on the RTTTL class defined in rtttl.py and the songs on RTTTL format defined in songs.py:
Changed:
<
<
https://afnog.iotworkshop.africa/pub/AFNOG/BuzzerShield/esp8266Buzzer.py.txt
>
>
https://github.com/uraich/MicroPython_IoTDemos/blob/master/drivers/buzzer/espBuzzer.py
 
Changed:
<
<
https://afnog.iotworkshop.africa/pub/AFNOG/BuzzerShield/rtttl.py.txt
>
>
https://github.com/uraich/MicroPython_IoTDemos/blob/master/drivers/buzzer/rtttl.py
 
Changed:
<
<
https://afnog.iotworkshop.africa/pub/AFNOG/BuzzerShield/songs.py.txt
>
>
https://github.com/uraich/MicroPython_IoTDemos/blob/master/drivers/buzzer/songs.py

rtttl.py and songs.py must be uploaded into the lib directory on the WeMos CPU flash with uPyCraft before being able to run espBuzzer.py. espBuzzer.py plays the Entertainer tune but you easily select another tune by changing a line in the source code.

The cayenne version of the buzzer program:

https://github.com/uraich/MicroPython_IoTDemos/blob/master/cayenne/buzzer/cayenneBuzzer.py

connects to Cayenne and waits for a song number to be played. Since Cayenne only knows 2 control widgets: the push button and the slider, using the Cayenne GUI is not that convenient for the selection of songs. I therefore wrote a QT application, connecting to Cayenne and publishing the song number for the cayenneBuzzer.py program.

Here is the code:

https://github.com/uraich/MicroPython_IoTDemos/tree/master/PC/cayenneBuzzer

and this is how the GUI looks like:

QtBuzzer.png

You first select the tune you want to hear. Pushing the "Play tune" button will send the number of the tune in the list to the Cayenne MQTT broker, which will pass it on to the cayenneBuzzer.py program to play it.

  -- Uli Raich - 2019-03-22
Line: 37 to 55
 
META FILEATTACHMENT attachment="rtttl.py.txt" attr="" comment="" date="1554476707" name="rtttl.py.txt" path="rtttl.py.txt" size="3884" user="UliRaich" version="1"
META FILEATTACHMENT attachment="songs.py.txt" attr="" comment="" date="1554476707" name="songs.py.txt" path="songs.py.txt" size="6348" user="UliRaich" version="1"
META FILEATTACHMENT attachment="firstTest.py.txt" attr="" comment="" date="1554476707" name="firstTest.py.txt" path="firstTest.py.txt" size="164" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="QtBuzzer.png" attr="" comment="" date="1558107985" name="QtBuzzer.png" path="QtBuzzer.png" size="23313" user="UliRaich" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback