tutorials/software

Get help, and assist others in with open source kits and running a business! Do not ask for legal advice or for consulting services in this forum, only general biz questions!

Moderators: adafruit_support_bill, adafruit

Forum rules
Get help, and assist others in with open source kits and running a business! Do not ask for legal advice or for consulting services in this forum, only general biz questions!
Locked
User avatar
rcomeau
 
Posts: 4
Joined: Tue Jun 19, 2012 11:37 am

tutorials/software

Post by rcomeau »

Just a few things that I have found over the last few days that may help make your products easier for people to use.

1. Change'Adafruit_i2c.py' to take a 1 or 0 for the i2c driver so that smbus is not needed in externial code:
Original:
def __init__(self, address, bus=smbus.SMBus(0), debug=False):
self.address = address
self.bus = bus
self.debug = debug
2. New:
def __init__(self, address, bus=1, debug=False): # rev 2
self.address = address
self.bus =smbus.SMBus(bus)
self.debug = debug

3. Servo demo:
a. You say in the tutorial that if you have rev 2 boards, that you must change:
self.i2c = Adafruit_I2C(address)
to 
self.i2c = Adafruit_I2C(address, bus=smbus.SMBus(1))

In order for the tutorial to work 'import smbus' must also be added to the
 Adafruit_PWM_Servo_Driver/Adafruit_PWM_Servo_Driver.py
Should be modified as per 1. above

b. ^C should shut down the demo, not leave it running! Haven't dug into the code yet.
4. I2c.py:
a. Adafruit_I2C.py file should be the same in:
/Adafruit-Raspberry-Pi-Python-Code/Adafruit_I2C
as in:
/Adafruit-Raspberry-Pi-Python-Code/Adafruit_BMP085(and elsewhere, and it's not!)
should use the same base file.


Seriously screws up the tabs!!!!!

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: tutorials/software

Post by adafruit_support_bill »

Thanks for the feedback! We are always trying to improve.
The best way to ensure this gets onto the author's to-do list is to post it in the comments & corrections link on the left of the tutorial page.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: tutorials/software

Post by adafruit »

we're updating the i2c sublibrary to auto-detect rev 1 or rev 2 shortly -

Locked
Forum rules
Get help, and assist others in with open source kits and running a business! Do not ask for legal advice or for consulting services in this forum, only general biz questions!

Return to “Kitbiz”