From 86d9cc4be4ff5203b682091e90256758097f2f73 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 21 Jan 2024 13:14:56 +0100 Subject: VEML6075: I²C reads need just one byte written per register MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/driver/veml6075.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/driver/veml6075.cc b/src/driver/veml6075.cc index 0ef3c08..dd6df25 100644 --- a/src/driver/veml6075.cc +++ b/src/driver/veml6075.cc @@ -26,25 +26,25 @@ bool VEML6075::readUVCounts(float *uva, float *uvb) { uint16_t uva_counts, uvb_counts, comp_visible, comp_ir; txbuf[0] = 0x07; - if (i2c.xmit(address, 2, txbuf, 2, rxbuf) != 0) { + if (i2c.xmit(address, 1, txbuf, 2, rxbuf) != 0) { return false; } uva_counts = ((uint16_t)rxbuf[1] << 8) + rxbuf[0]; txbuf[0] = 0x09; - if (i2c.xmit(address, 2, txbuf, 2, rxbuf) != 0) { + if (i2c.xmit(address, 1, txbuf, 2, rxbuf) != 0) { return false; } uvb_counts = ((uint16_t)rxbuf[1] << 8) + rxbuf[0]; txbuf[0] = 0x0a; - if (i2c.xmit(address, 2, txbuf, 2, rxbuf) != 0) { + if (i2c.xmit(address, 1, txbuf, 2, rxbuf) != 0) { return false; } comp_visible = ((uint16_t)rxbuf[1] << 8) + rxbuf[0]; txbuf[0] = 0x0b; - if (i2c.xmit(address, 2, txbuf, 2, rxbuf) != 0) { + if (i2c.xmit(address, 1, txbuf, 2, rxbuf) != 0) { return false; } comp_ir = ((uint16_t)rxbuf[1] << 8) + rxbuf[0]; -- cgit v1.2.3