Skip to content

Commit ea59752

Browse files
committed
BUZZERconfig argument re-ordering
I want toneFrequency as first argument
1 parent 6890579 commit ea59752

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SparkFun_Qwiic_Buzzer_Arduino_Library.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ unsigned long QwiicBuzzer::popClickedQueue()
262262
}
263263

264264
/*------------------------ LED Configuration ------------------------ */
265-
bool QwiicBuzzer::BUZZERconfig(uint8_t brightness, uint16_t toneFrequency, uint16_t offTime, uint8_t granularity)
265+
bool QwiicBuzzer::BUZZERconfig(uint16_t toneFrequency, uint8_t brightness, uint16_t offTime, uint8_t granularity)
266266
{
267267
bool success = writeSingleRegister(SFE_QWIIC_BUTTON_LED_BRIGHTNESS, brightness);
268268
success &= writeSingleRegister(SFE_QWIIC_BUTTON_LED_PULSE_GRANULARITY, granularity);
@@ -283,7 +283,7 @@ bool QwiicBuzzer::LEDon(uint8_t brightness)
283283

284284
bool QwiicBuzzer::on(uint16_t toneFrequency, uint8_t brightness)
285285
{
286-
return BUZZERconfig(brightness, toneFrequency, 0);
286+
return BUZZERconfig(toneFrequency, brightness, 0);
287287
}
288288

289289
bool QwiicBuzzer::off()

src/SparkFun_Qwiic_Buzzer_Arduino_Library.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class QwiicBuzzer
7575
unsigned long popClickedQueue(); //Returns the oldest value in the queue (milliseconds since first button click), and then removes it.
7676

7777
//LED configuration
78-
bool BUZZERconfig(uint8_t brightness, uint16_t toneFrequency,
78+
bool BUZZERconfig(uint16_t toneFrequency, uint8_t brightness,
7979
uint16_t offTime, uint8_t granularity = 1); //Configures the LED with the given max brightness, granularity (1 is fine for most applications), cycle time, and off time.
8080
bool LEDoff(); //Turns the onboard LED off
8181
bool LEDon(uint8_t brightness = 255); //Turns the onboard LED on with specified brightness. Set brightness to an integer between 0 and 255, where 0 is off and 255 is max brightness.

0 commit comments

Comments
 (0)