I2C send vs write #523
-
This package for interacting with I2C has both Additionally, "command code" is a parameter in the two functions of the i2c-bus package, which it is not a parameter in the Kaluma I2C API. Does this matter at all? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @slashinfty e.g) writeByte(SLAVE_ADDR, command, onebytedata) --> i2c.memWrite(onebytedata, SLAVE_ADDR, command) |
Beta Was this translation helpful? Give feedback.
-
Thanks! This helped me finish writing a package for Kaluma. |
Beta Was this translation helpful? Give feedback.
Hi @slashinfty
Kaluma
i2c.write()
function is the same assendByte
function and Kalumai2c.memWrite()
function is similar aswriteByte
function.When you want to use
i2c.memWrite()
function as a 'writeByte', you need to set memAddressSize to 8 (Default) and usememAddress
for thecommand
of thewriteByte
. One difference is 'i2c.memWrite() is synchronous butwriteByte
is asynchronous function.e.g) writeByte(SLAVE_ADDR, command, onebytedata) --> i2c.memWrite(onebytedata, SLAVE_ADDR, command)