No products
Follow us on facebook
This kit is the ideal solution for those who want to start to prototype...
Prototype with ARDUINO / GENUINO boards without having a lot of wires...
Easily adapt SMD devices to 2.54mm prototyping breadboards.
Prototype with ARDUINO / GENUINO boards without having a lot of wires...
Published : 04/01/2022 09:32:25
Categories : IoT Proto Shield Plus , Proto Shield Plus
The SPEAKER can be used as a buzzer or to create frequency modulated tones.
It can also be used to play mp3 files in addition with the MP3 Mini Player, but in this article we will see how to use it as a buzzer or to create frequency modulated tones.
SPEAKER Section of the IoT Proto Shield Plus
Since the speaker is primarily used to play MP3 files in addition with the MP3 mini Player, to use it to play frequency modulated tones two jumper wires are required.
Schematic of the IoT Proto Shield Plus SPEAKER Section
To let the SPEAKER work as a tone buzzer you have to:
According to the above schematics, U_TX will drive the buzzer tone. U_TX connects by default to the following pins:
Download the sample sketches by clicking here.
Location: IoTPSP_Sample_Sketches/IoTPSP_SPEAKER
Use the IoTPSP_SPEAKER_NANO sketch to test the SPEAKER with ARDUINO NANO boards.
The IoTPSP_SPEAKER_NANO is based on the tone() function of the Arduino base library.
Information about the Arduino tone() function can be found at this link: https://www.arduino.cc/reference/en/language/functions/advanced-io/tone/
The function does not work on NANO33 BLE (at least at the moment of writing this article).
Use the IoTPSP_SPEAKER_ESP32 sketch to test the SPEAKER with ESP32 boards.
The IoTPSP_SPEAKER_ESP32 uses the Tone32 library. The library is downloadable at https://github.com/lbernstone/Tone32
A copy of the library is also contained in the sketch folder.
Use the IoTPSP_SPEAKER_ESP8266 sketch to test the SPEAKER with ESP8266 boards.
The IoTPSP_SPEAKER_ESP8266 is based on the tone() function of the Arduino base library.
Information about the Arduino tone() function can be found at this link: https://www.arduino.cc/reference/en/language/functions/advanced-io/tone/