Skip to content

Commit 5b34bd7

Browse files
authored
Merge pull request #3 from sparkfun/feature/sf-toolkit-v1
updates for Tk v1.0; structure changes for current pattern; cleanup a…
2 parents 152ce07 + 0fce2fe commit 5b34bd7

8 files changed

+469
-492
lines changed

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name=SparkFun Qwiic Buzzer Library
2-
version=1.0.1
2+
version=1.1.0
33
author=SparkFun Electronics <techsupport@sparkfun.com>
44
maintainer=SparkFun Electronics <support@sparkfun.com>
55
sentence=Communicates with and configures the SparkFun Qwiic Buzzer
66
paragraph=This library allows the user to control the buzzer frequency/duration, and change its I2C addresses.
77
category=Outputs
88
url=https://github.com/sparkfun/SparkFun_Qwiic_Buzzer_Arduino_Library
99
architectures=*
10-
depends=SparkFun Toolkit (<1.0.0)
10+
depends=SparkFun Toolkit (>=1.0.0)
Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
1-
/******************************************************************************
2-
SparkFun_Qwiic_Buzzer_Arduino_Library.h
3-
SparkFun Qwiic Buzzer Library header file
4-
5-
by Pete Lewis @SparkFun Electronics
6-
January 2024
7-
8-
Based on original source code written by
9-
Fischer Moseley @ SparkFun Electronics
10-
Original Creation Date: July 24, 2019
11-
12-
This file implements the QwiicBuzzer class, prototyped in SparkFun_Qwiic_Buzzer_Arduino_Library.h
13-
14-
Development environment specifics:
15-
IDE: Arduino 2.2.1
16-
Hardware Platform: Arduino Uno/SparkFun Redboard
17-
Qwiic Buzzer Version: v10
18-
19-
SPDX-License-Identifier: MIT
20-
21-
Copyright (c) 2024 SparkFun Electronics
22-
23-
Distributed as-is; no warranty is given.
24-
******************************************************************************/
1+
/**
2+
* @file SparkFun_Qwiic_Buzzer_Arduino_Library.h
3+
* @brief SparkFun Qwiic Buzzer Library header file
4+
* @author Pete Lewis \@SparkFun Electronics
5+
* @date January 2024
6+
*
7+
* @note Based on original source code written by Fischer Moseley \@ SparkFun Electronics
8+
* Original Creation Date: July 24, 2019
9+
*
10+
* @details This file implements the QwiicBuzzer class, prototyped in SparkFun_Qwiic_Buzzer_Arduino_Library.h
11+
*
12+
* @copyright Copyright (c) 2024 SparkFun Electronics. This project is released under the MIT License.
13+
* @license SPDX-License-Identifier: MIT
14+
*
15+
*/
2516

2617
#pragma once
2718

28-
#include "sfeQwiicBuzzer.h"
19+
// clang-format off
2920
#include <SparkFun_Toolkit.h>
30-
31-
class QwiicBuzzer : public sfeQwiicBuzzer
21+
#include "sfTk/sfDevBuzzer.h"
22+
// clang-format on
23+
class QwiicBuzzer : public sfDevBuzzer
3224
{
3325
public:
3426
/// @brief Begins the Qwiic Buzzer
@@ -41,16 +33,16 @@ class QwiicBuzzer : public sfeQwiicBuzzer
4133
_theI2CBus.init(wirePort, address);
4234

4335
// Begin the sensor
44-
return sfeQwiicBuzzer::begin(&_theI2CBus) == kSTkErrOk;
36+
return sfDevBuzzer::begin(&_theI2CBus) == ksfTkErrOk;
4537
}
4638

4739
/// @brief Checks if the Qwiic Buzzer is connected
4840
/// @return True if the sensor is connected, false otherwise
4941
bool isConnected()
5042
{
51-
return sfeQwiicBuzzer::isConnected() == kSTkErrOk;
43+
return sfDevBuzzer::isConnected() == ksfTkErrOk;
5244
}
5345

5446
private:
55-
sfeTkArdI2C _theI2CBus;
47+
sfTkArdI2C _theI2CBus;
5648
};

0 commit comments

Comments
 (0)