How To Use I2C
Mike Marks
Posts: 3
I am a first time user of the I2C command having recently purchased an Adafruit INA219 current and voltage measurement breakout board. For the write operation, the INA219 does not require an address after the saveID. Can one write via a Stamp2p:
Sid con %10000000
I2Cout,0,Sid,[$02] leaving out the address after the slaveID?
Or, does one have to include a 0 just to fill the address, as in:
I2Cout 0,$Sid,0,[$02]
Or, are both acceptable?
Mike Marks
Milwaukee
Sid con %10000000
I2Cout,0,Sid,[$02] leaving out the address after the slaveID?
Or, does one have to include a 0 just to fill the address, as in:
I2Cout 0,$Sid,0,[$02]
Or, are both acceptable?
Mike Marks
Milwaukee
Comments
Thanks for the reply. I had been reading the old book, Stamp Works Version 1.1, which does not list the address parameter as an option. After your mention, I then consulted the newer Syntax & Reference Manual which states it's optional. Sometimes 4 eyes are better than 2!
I would have preferred to purchase the INA219 breakout board form Parallax, rather than Adafruit.com, as you provide sample BASIC software for us users to get a quick start rather than struggling to learn a new IC and deciphering a sometimes arcane data sheet. Any thoughts of Parallax supplying such a breakout board in future? Very handy and accurate, gives voltage & current readout with no A to D required.
Seems breakout boards are getting more important as lots of ICs now come only in surface mount, then how do we mount them to a proto board.
Mike Marks