Skip to content

Commit

Permalink
added the get_address() method to the class
Browse files Browse the repository at this point in the history
  • Loading branch information
Atlas-Scientific committed Apr 29, 2020
1 parent 32e1eda commit c7b3b17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Ezo_i2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions Ezo_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c7b3b17

Please sign in to comment.