diff --git a/Ezo_i2c.cpp b/Ezo_i2c.cpp index 6288c4c..dbf9d5c 100644 --- a/Ezo_i2c.cpp +++ b/Ezo_i2c.cpp @@ -17,6 +17,10 @@ const char* Ezo_board::get_name(){ return this->name; } +uint8_t Ezo_board::get_address(){ + return i2c_address; +} + void Ezo_board::send_cmd(const char* command) { Wire.beginTransmission(this->i2c_address); Wire.write(command); diff --git a/Ezo_i2c.h b/Ezo_i2c.h index 6fdb022..29f6d42 100644 --- a/Ezo_i2c.h +++ b/Ezo_i2c.h @@ -83,6 +83,10 @@ class Ezo_board{ //returns the error status of the last received command, //used to check the validity of the data returned by get_reading() + uint8_t get_address(); + //returns the address of the device + + protected: uint8_t i2c_address; const char* name = 0;