diff --git a/src/107-Arduino-TSL2550.cpp b/src/107-Arduino-TSL2550.cpp index cccff56..a244923 100644 --- a/src/107-Arduino-TSL2550.cpp +++ b/src/107-Arduino-TSL2550.cpp @@ -46,9 +46,9 @@ bool ArduinoTSL2550::begin(bool const use_extended) } if (use_extended) - _io.write(TSL2550::Register::WriteCommandExtendedRange, 0); + _io.write(TSL2550::Register::WriteCommandExtendedRange); else - _io.write(TSL2550::Register::WriteCommandStandardRange, 0); + _io.write(TSL2550::Register::WriteCommandStandardRange); return true; } @@ -82,7 +82,7 @@ float ArduinoTSL2550::get_lux() void ArduinoTSL2550::powerdown() { - _io.write(TSL2550::Register::PowerDownState, 0); + _io.write(TSL2550::Register::PowerDownState); } TSL2550::Error ArduinoTSL2550::error() diff --git a/src/TSL2550/TSL2550_Io.cpp b/src/TSL2550/TSL2550_Io.cpp index b819fa7..121b6e5 100644 --- a/src/TSL2550/TSL2550_Io.cpp +++ b/src/TSL2550/TSL2550_Io.cpp @@ -34,6 +34,12 @@ TSL2550_Io::TSL2550_Io(I2cWriteFunc write, I2cReadFunc read, uint8_t const i2c_s * PUBLIC MEMBER FUNCTIONS **************************************************************************************/ +void TSL2550_Io::write(Register const reg) +{ + uint8_t const val=0; + write(reg, &val, 0); +} + uint8_t TSL2550_Io::read(Register const reg) { uint8_t data = 0; diff --git a/src/TSL2550/TSL2550_Io.h b/src/TSL2550/TSL2550_Io.h index fb20bbb..1179e51 100644 --- a/src/TSL2550/TSL2550_Io.h +++ b/src/TSL2550/TSL2550_Io.h @@ -43,6 +43,7 @@ class TSL2550_Io TSL2550_Io(I2cWriteFunc write, I2cReadFunc read, uint8_t const i2c_slave_addr); + void write(Register const reg); uint8_t read (Register const reg); void write(Register const reg, uint8_t const val); void read (Register const reg, uint8_t * buf, size_t const bytes);