Skip to content

use of basic I2C communication #9418

Sep 25, 2022 · 6 comments · 9 replies
Discussion options

You must be logged in to vote

ok, true... cables are not highest quality and had to check cables. It seems to work now. Thanks! Now it works as a charm.

I still have issues to understand that code. Can you explain how he reads 16 bit registers here?
self._i2c.readfrom_mem(self._addr, register, 2)
will read 2x8bit from 2 registers to my understanding. So if i will read 0x10 it will read 0x10 & 0x11. It will not grab 0x1000 register as a whole, unless i misunderstand the concept, meaning reading 2 bytes will continue reading from the same register as its simply 2 bytes long. My imagination tells me that it will read 2x8bit from 2 registers not from 1.

Replies: 6 comments 9 replies

Comment options

You must be logged in to vote
2 replies
@awsiuk
Comment options

@robert-hh
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by robert-hh
Comment options

You must be logged in to vote
3 replies
@steveh127
Comment options

@hardikofficial963
Comment options

@peterhinch
Comment options

Comment options

You must be logged in to vote
1 reply
@hardikofficial963
Comment options

Comment options

You must be logged in to vote
1 reply
@hardikofficial963
Comment options

Comment options

You must be logged in to vote
2 replies
@hardikofficial963
Comment options

@bixb922
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
8 participants