Can someone explain why the I2c.write takes a string for the data?
seems strange to take "string" values.
such as if I wanted to write 3 bytes:
_i2c.write(_addr,"\x02" + "\x00" + "\x00");
Yet using spi.write I dont need to do that. These "writes" should follow the same format.
And since it does take string values then why doesn't this then work;
local value = blob(3);
value.writen("\x02",'b'); // also tried the 'c' parm and still no go.
I mean it does for the spi write, why not then for the I2c ?
Lastly, how does one take in a value from say a sensor, then pass this value to a I2C device?
The data is going to be raw, and then I need to convert it to a string so I can pass it along using i2c. write.