Thank you Smitty,
I plugged the sensor in Arduino and changed the address, that was the issue.
Some data is coming out, but it is repeating , when set on a loop. Is there a way to loop this structure in order to get new values each reading?
My updated code:
hardware.i2c89.configure(CLOCK_SPEED_100_KHZ);
local i2c = hardware.i2c89;
local i2cAddress = 0x04 << 1;
const Measurment_freq = 5.0;
function readSensor()
{
local breakFlag = false;
function readData()
{
local force = i2c.read(i2cAddress, “\x04”, 2);
server.log(readData);
}
i2c.write(i2cAddress, “\x02\x29\x02\x00\x00\xFF”);
imp.wakeup(1.0,readData);
if (!breakFlag)
{
imp.wakeup(Measurment_freq,readSensor)
}
}
readSensor();