|
30 | 30 |
|
31 | 31 | class QwiicBuzzer : public sfeQwiicBuzzer |
32 | 32 | { |
33 | | - public: |
34 | | - /// @brief Begins the Qwiic Buzzer |
35 | | - /// @param address I2C device address to use for the sensor |
36 | | - /// @param wirePort Wire port to use for I2C communication |
37 | | - /// @return True if successful, false otherwise |
38 | | - bool begin(const uint8_t address = SFE_QWIIC_BUZZER_DEFAULT_ADDRESS, TwoWire &wirePort = Wire) |
39 | | - { |
40 | | - // Setup Arudino I2C bus |
41 | | - _theI2CBus.init(wirePort, address); |
42 | | - |
43 | | - // Begin the sensor |
44 | | - return sfeQwiicBuzzer::begin(&_theI2CBus) == kSTkErrOk; |
45 | | - } |
46 | | - |
47 | | - /// @brief Checks if the Qwiic Buzzer is connected |
48 | | - /// @return True if the sensor is connected, false otherwise |
49 | | - bool isConnected() |
50 | | - { |
51 | | - return sfeQwiicBuzzer::isConnected() == kSTkErrOk; |
52 | | - } |
53 | | - |
54 | | - private: |
55 | | - sfeTkArdI2C _theI2CBus; |
| 33 | +public: |
| 34 | + /// @brief Begins the Qwiic Buzzer |
| 35 | + /// @param address I2C device address to use for the sensor |
| 36 | + /// @param wirePort Wire port to use for I2C communication |
| 37 | + /// @return True if successful, false otherwise |
| 38 | + bool begin(const uint8_t address = SFE_QWIIC_BUZZER_DEFAULT_ADDRESS, TwoWire &wirePort = Wire) |
| 39 | + { |
| 40 | + // Setup Arudino I2C bus |
| 41 | + _theI2CBus.init(wirePort, address); |
| 42 | + |
| 43 | + // Begin the sensor |
| 44 | + return sfeQwiicBuzzer::begin(&_theI2CBus) == kSTkErrOk; |
| 45 | + } |
| 46 | + |
| 47 | + /// @brief Checks if the Qwiic Buzzer is connected |
| 48 | + /// @return True if the sensor is connected, false otherwise |
| 49 | + bool isConnected() |
| 50 | + { |
| 51 | + return sfeQwiicBuzzer::isConnected() == kSTkErrOk; |
| 52 | + } |
| 53 | + |
| 54 | +private: |
| 55 | + sfeTkArdI2C _theI2CBus; |
56 | 56 | }; |
0 commit comments