#include <SparkFun_Qwiic_Buzzer_Arduino_Library.h>
◆ address()
uint8_t sfDevBuzzer::address |
( |
| ) |
|
|
inherited |
Gets the current I2C address of the Qwiic Buzzer.
- Returns
- The current I2C address, 7-bit unshifted
◆ begin() [1/2]
Begins the Qwiic Buzzer.
- Parameters
-
address | I2C device address to use for the sensor |
wirePort | Wire port to use for I2C communication |
- Returns
- True if successful, false otherwise
◆ begin() [2/2]
sfTkError_t sfDevBuzzer::begin |
( |
sfTkII2C * |
theBus = nullptr | ) |
|
|
inherited |
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 | ) |
|
|
inherited |
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 | ) |
|
|
inherited |
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 | ) |
|
|
inherited |
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()
bool QwiicBuzzer::isConnected |
( |
| ) |
|
|
inline |
Checks if the Qwiic Buzzer is connected.
- Returns
- True if the sensor is connected, false otherwise
◆ off()
sfTkError_t sfDevBuzzer::off |
( |
| ) |
|
|
inherited |
Turns off buzzer.
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ on()
sfTkError_t sfDevBuzzer::on |
( |
| ) |
|
|
inherited |
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 |
|
) |
| |
|
inherited |
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 |
( |
| ) |
|
|
inherited |
Stores settings to EEPROM.
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ setAddress()
sfTkError_t sfDevBuzzer::setAddress |
( |
const uint8_t & |
address | ) |
|
|
inherited |
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 |
|
protectedinherited |
The documentation for this class was generated from the following file: