Skip to content

Renamed DEFAULT_ADDRESS to avoid conflicts with other libs #5 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/SparkFun_Qwiic_Button.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Distributed as-is; no warranty is given.
#include <Arduino.h>
#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
Expand All @@ -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
Expand Down Expand Up @@ -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
#endif