Skip to content

Commit 54ca41b

Browse files
authored
Merge pull request #7 from makesaur/master
Renamed DEFAULT_ADDRESS to avoid conflicts with other libs #5
2 parents 15b5aa8 + efea798 commit 54ca41b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SparkFun_Qwiic_Button.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Distributed as-is; no warranty is given.
2626
#include <Arduino.h>
2727
#include "registers.h"
2828

29-
#define DEFAULT_ADDRESS 0x6F //default I2C address of the button
29+
#define DEFAULT_QWIIC_BUTTON_ADDRESS 0x6F //default I2C address of the button
3030
#define DEV_ID 0x5D //device ID of the Qwiic Button
3131

3232
class QwiicButton
@@ -37,7 +37,7 @@ class QwiicButton
3737

3838
public:
3939
//Device status
40-
bool begin(uint8_t address = DEFAULT_ADDRESS, TwoWire &wirePort = Wire); //Sets device I2C address to a user-specified address, over whatever port the user specifies.
40+
bool begin(uint8_t address = DEFAULT_QWIIC_BUTTON_ADDRESS, TwoWire &wirePort = Wire); //Sets device I2C address to a user-specified address, over whatever port the user specifies.
4141
bool isConnected(); //Returns true if the button/switch will acknowledge over I2C, and false otherwise
4242
uint8_t deviceID(); //Return the 8-bit device ID of the attached device.
4343
bool checkDeviceID(); //Returns true if the device ID matches that of either the button or the switch
@@ -89,4 +89,4 @@ class QwiicButton
8989
uint8_t writeSingleRegisterWithReadback(Qwiic_Button_Register reg, uint8_t data); //Writes data into a single 8-bit register, and checks to make sure that the data was written successfully. Returns 0 on no error, 1 on I2C write fail, and 2 if the register doesn't read back the same value that was written.
9090
uint16_t writeDoubleRegisterWithReadback(Qwiic_Button_Register reg, uint16_t data); //Writes data into a double (two 8-bit) registers, and checks to make sure that the data was written successfully. Returns 0 on no error, 1 on I2C write fail, and 2 if the register doesn't read back the same value that was written.
9191
};
92-
#endif
92+
#endif

0 commit comments

Comments
 (0)