Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

AdaFruit_I2C reg parameter
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

AdaFruit_I2C reg parameter

by madGambol on Tue Sep 06, 2016 11:18 am

Hi,

In the AdaFruit_I2C python class, I don't understand the meaning of the "reg" parameter. In an I2C operation, I have N bytes to read or write --- no register factors into that.

I need to be able to read or write N bytes from an I2C address. With that "reg" parameter that I don't understand, none of the methods appear to do what I need.

How do I do the basic read and write operations?

Thanks,

madGambol

madGambol
 
Posts: 5
Joined: Wed Jul 02, 2014 1:03 am

Re: AdaFruit_I2C reg parameter

by drewfustini on Wed Sep 07, 2016 12:15 am

What I2C device are you communicating with?

I believe the reg argument could also be thought of as offset. If you really have no registers in your i2c device, then I'd suggest always using reg argument of 0.

drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Please be positive and constructive with your questions and comments.