#include <sfDevBuzzer.h>
|
| sfDevBuzzer () |
| Default constructor. More...
|
|
sfTkError_t | begin (sfTkII2C *theBus=nullptr) |
| Begins the Qwiic Buzzer. More...
|
|
sfTkError_t | isConnected () |
| Checks if the Qwiic Buzzer is connected. More...
|
|
sfTkError_t | deviceId (uint8_t &deviceId) |
| Reads the Device ID of the Qwiic Buzzer. More...
|
|
bool | firmwareVersionMajor (uint8_t &versionMajor) |
| Reads the Firmware Version Major of the Qwiic Buzzer. More...
|
|
bool | firmwareVersionMinor (uint8_t &versionMinor) |
| Reads the Firmware Version Minor of the Qwiic Buzzer. More...
|
|
sfTkError_t | configureBuzzer (const uint16_t toneFrequency=SFE_QWIIC_BUZZER_RESONANT_FREQUENCY, const uint16_t duration=0, const uint8_t volume=4) |
| Configures the Qwiic Buzzer without causing the buzzer to buzz. This allows configuration in silence (before you may want to buzz). It is also useful in combination with saveSettings(), and then later causing buzzing by using the physical TRIGGER pin. To start buzzing (via Qwiic) with your desired configuration, use this function, then call on(). More...
|
|
sfTkError_t | on () |
| Turns on buzzer. More...
|
|
sfTkError_t | off () |
| Turns off buzzer. More...
|
|
sfTkError_t | saveSettings () |
| Stores settings to EEPROM. More...
|
|
sfTkError_t | setAddress (const uint8_t &address) |
| Changes the I2C address of the Qwiic Buzzer. More...
|
|
uint8_t | address () |
| Gets the current I2C address of the Qwiic Buzzer. More...
|
|
bool | playSoundEffect (const uint8_t soundEffectNumber, const uint8_t volume) |
| Plays one of the sound effects included in this library. More...
|
|
◆ sfDevBuzzer()
sfDevBuzzer::sfDevBuzzer |
( |
| ) |
|
|
inline |
◆ address()
uint8_t sfDevBuzzer::address |
( |
| ) |
|
Gets the current I2C address of the Qwiic Buzzer.
- Returns
- The current I2C address, 7-bit unshifted
◆ begin()
sfTkError_t sfDevBuzzer::begin |
( |
sfTkII2C * |
theBus = nullptr | ) |
|
Begins the Qwiic Buzzer.
- Parameters
-
theBus | I2C bus to use for communication |
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ configureBuzzer()
Configures the Qwiic Buzzer without causing the buzzer to buzz. This allows configuration in silence (before you may want to buzz). It is also useful in combination with saveSettings(), and then later causing buzzing by using the physical TRIGGER pin. To start buzzing (via Qwiic) with your desired configuration, use this function, then call on().
- Parameters
-
toneFrequency | Frequency in Hz of buzzer tone |
duration | Duration in milliseconds (0 = forever) |
volume | Volume (4 settings; 0=off, 1=quiet... 4=loudest) |
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ deviceId()
sfTkError_t sfDevBuzzer::deviceId |
( |
uint8_t & |
deviceId | ) |
|
Reads the Device ID of the Qwiic Buzzer.
- Parameters
-
deviceId | uint8_t variable where the read results will be stored |
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ firmwareVersionMajor()
bool sfDevBuzzer::firmwareVersionMajor |
( |
uint8_t & |
versionMajor | ) |
|
Reads the Firmware Version Major of the Qwiic Buzzer.
- Parameters
-
versionMajor | Variable where the read results will be stored |
- Returns
- 1 for succuss, 0 error
◆ firmwareVersionMinor()
bool sfDevBuzzer::firmwareVersionMinor |
( |
uint8_t & |
versionMinor | ) |
|
Reads the Firmware Version Minor of the Qwiic Buzzer.
- Parameters
-
versionMinor | Variable where the read results will be stored |
- Returns
- 1 for succuss, 0 error
◆ isConnected()
sfTkError_t sfDevBuzzer::isConnected |
( |
| ) |
|
Checks if the Qwiic Buzzer is connected.
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ off()
sfTkError_t sfDevBuzzer::off |
( |
| ) |
|
Turns off buzzer.
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ on()
sfTkError_t sfDevBuzzer::on |
( |
| ) |
|
Turns on buzzer.
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ playSoundEffect()
bool sfDevBuzzer::playSoundEffect |
( |
const uint8_t |
soundEffectNumber, |
|
|
const uint8_t |
volume |
|
) |
| |
Plays one of the sound effects included in this library.
- Parameters
-
soundEffectNumber | The sound effect you with to play |
volume | Volume (4 settings; 0=off, 1=quiet... 4=loudest) |
- Returns
- 1 for succuss, 0 error
◆ saveSettings()
sfTkError_t sfDevBuzzer::saveSettings |
( |
| ) |
|
Stores settings to EEPROM.
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ setAddress()
sfTkError_t sfDevBuzzer::setAddress |
( |
const uint8_t & |
address | ) |
|
Changes the I2C address of the Qwiic Buzzer.
- Parameters
-
address | New address, must be in the range 0x08 to 0x77 |
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ _theBus
sfTkII2C* sfDevBuzzer::_theBus |
|
protected |
The documentation for this class was generated from the following files: