Cannot write to Silicon Labs Si7013 User register 2

Si7013.write(Addr<<1,"\x50");
imp.sleep(0.01);
local m = Si7013.write(Addr<<1, “\x0E”);
imp.sleep(0.01);

These simple lines of code cannot write 15 to the user register 2 of the sensor.
Is there any thing I’m missing? The result is always 0 (meaning success) but when I read the register again its not written.
I have the latest impOS upgraded today.

Many thanks for help.

I have some Si7021’s on order… when they get here I’ll take a look myself. I believe the I2C interface is the same.

Each i2c.write() call is a separate transaction; it’s not a streaming interface like a UART is. I think you want
Si7013.write(Addr<<1, "\\x50\\x0F");
to write 0xF (15) to register 2.

Peter

Thanks Peter, it works.