Skip to content

I2C send vs write #523

Answered by communix
slashinfty asked this question in Help
Discussion options

You must be logged in to vote

Hi @slashinfty
Kaluma i2c.write() function is the same as sendByte function and Kaluma i2c.memWrite() function is similar as writeByte function.
When you want to use i2c.memWrite() function as a 'writeByte', you need to set memAddressSize to 8 (Default) and use memAddress for the command of the writeByte. One difference is 'i2c.memWrite() is synchronous but writeByte is asynchronous function.

e.g) writeByte(SLAVE_ADDR, command, onebytedata) --> i2c.memWrite(onebytedata, SLAVE_ADDR, command)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by slashinfty
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants