Thread: i2c output
View Single Post
  #5   Spotlight this post!  
Unread 15-01-2009, 07:23
gvarndell's Avatar
gvarndell gvarndell is offline
Software Engineer
AKA: Addi's and Georgie's Dad
FRC #1629 (GaCo)
Team Role: Parent
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Grantsville, Maryland
Posts: 350
gvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond repute
Re: i2c output

Quote:
Originally Posted by virtuald View Post
Right, I knew that part. But it seems to me that the Write() function is referring to a different address.
I2C devices have a bus address -- the address to which the device itself responds for reads or writes.
Internally, they may (and usually do) have multiple registers.
These registers are numerically indexed -- 0, 1, ... N.
If the I2c device you want to access only has 1 user accessible register, then use register address (register number) 0.
Additionally, for I2C devices that do have multiple internal registers, you can read or write multiple consecutive registers by specifying the first register number and supplying multiple bytes of data.