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!

tutorials/software

Postby rcomeau » Fri Dec 07, 2012 6:22 pm

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!!!!!
rcomeau
 
Posts: 3
Joined: Tue Jun 19, 2012 10:37 am

Re: tutorials/software

Postby adafruit_support_bill » Sat Dec 08, 2012 6:48 am

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.
User avatar
adafruit_support_bill
 
Posts: 16617
Joined: Sat Feb 07, 2009 9:11 am

Re: tutorials/software

Postby adafruit » Sat Dec 08, 2012 2:50 pm

we're updating the i2c sublibrary to auto-detect rev 1 or rev 2 shortly -
User avatar
adafruit
 
Posts: 10546
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc


Return to Kitbiz

Who is online

Users browsing this forum: No registered users and 2 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [114]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]