Converting a Script from using 'smbus' to using 'board'

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
xanatos
 
Posts: 110
Joined: Thu Jun 18, 2009 3:09 pm

Converting a Script from using 'smbus' to using 'board'

Post by xanatos »

Original script imports 'smbus' and has this call:

Code: Select all

rslt = self.i2cbus.read_i2c_block_data(self.__addr, reg, len)
For compatibility with the five other sensors working in this project, I am converting to use 'board' instead of 'smbus'.

It logically follows that the "i2cbus.read_i2c_block_data" call then errors out for "I2C object has no attribute 'i2cbus.read_i2c_block_data'".

Is there a good place I can go to find what the 'import board' version would be for 'i2cbus.read_i2c_block_data'?

Thanks!

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”