From efea7982bf78b16ea47b61e6bec834375503f993 Mon Sep 17 00:00:00 2001 From: makesaur <100735515+makesaur@users.noreply.github.com> Date: Tue, 15 Mar 2022 22:26:21 -0400 Subject: [PATCH] Renamed DEFAULT_ADDRESS to avoid conflicts with other libs #5 --- src/SparkFun_Qwiic_Button.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SparkFun_Qwiic_Button.h b/src/SparkFun_Qwiic_Button.h index c0a9d72..ac18a9e 100644 --- a/src/SparkFun_Qwiic_Button.h +++ b/src/SparkFun_Qwiic_Button.h @@ -26,7 +26,7 @@ Distributed as-is; no warranty is given. #include #include "registers.h" -#define DEFAULT_ADDRESS 0x6F //default I2C address of the button +#define DEFAULT_QWIIC_BUTTON_ADDRESS 0x6F //default I2C address of the button #define DEV_ID 0x5D //device ID of the Qwiic Button class QwiicButton @@ -37,7 +37,7 @@ class QwiicButton public: //Device status - 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. + 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. bool isConnected(); //Returns true if the button/switch will acknowledge over I2C, and false otherwise uint8_t deviceID(); //Return the 8-bit device ID of the attached device. bool checkDeviceID(); //Returns true if the device ID matches that of either the button or the switch @@ -89,4 +89,4 @@ class QwiicButton 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. 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. }; -#endif \ No newline at end of file +#endif