[HH] Seeking help on Programming I2C bus in python on Raspberry Pi

Jon Evans jon at craftyjon.com
Wed Nov 14 15:26:26 EST 2012


To clarify: you currently have a setup with a Pi connected to a MCP23017 via
I2C, and the MCP23017 is driving your LED bar, correct?

Can you follow the SKPang demo code:
http://www.skpang.co.uk/blog/wp-content/uploads/2012/06/ledchaser.py

It uses the Python smbus module to talk to the I2C driver (SMBus and I2C
are *basically* the same thing in this scenario).

To understand it, you have to learn about the standard I2C protocol for
reading/writing registers on a device (see Greg's email), and then look at
the MCP23017 datasheet to figure out what each register does.


On Wed, Nov 14, 2012 at 11:41 AM, Ming kuo <mingtkuo at gmail.com> wrote:

> Hi Guys, I was recently introduced to this group, so here is my first post.
>
> I work/volunteer at the Southend Technology Center in Boston.  We teach
> technology to kids and adults fostering interest in technology for kids and
> enabling adults to be more competitive in the workforce.  We were the
> original Fab Lab initiated by MIT, and continue to have a strong
> relationship with MIT.  We have laser cutters, shopbot, broken 3D printer,
> and teach kids to work with arduino.
>
> I manage the computer hardware repair workshop.
>
> So I have taken on a project (over my head) using old computer parts and
> raspberry Pi.  I am trying to build a POV sign that can gather data from
> the net/cloud/remotely.
>
> I have followed this example http://www.skpang.co.uk/blog/archives/454 to
> get LEDs controlled by a raspberry.  But now like to convert this to using
> this http://adafruit.com/products/459 a bi-color 12 bar led (for more
> colors and cleaner product)
>
> I figured out the wiring to get the bar to light up using the same codes
> as above.  So I am now ready to control the LED bar, and that is where I am
> stuck...on the python code to control the I2C.  I think my too basic
> knowledge of electronics and programming would be benefited by someones
> help.  This is my immediate challenge to figure out how to program the I2C
> for the LED bar, then eventually, I need to program a python code to POV
> display the messages which i can imaging that it get pretty challenging
> given how to form a character with LED while timing the rotation.
>
> So I am looking for someone who maybe familiar with I2C to offer insight
> and hopefully someone that has time to tinker on this project along with
> me.  I am at the tech center typically in the afternoons till 8PM at 359
> Columbus Ave in the Southend.
>
> So any help through email or in person would be greatly appreciated.
>
> Thanks
>
> Ming
>
> _______________________________________________
> Hardwarehacking mailing list
> Hardwarehacking at blu.org
> http://lists.blu.org/mailman/listinfo/hardwarehacking
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blu.org/pipermail/hardwarehacking/attachments/20121114/630afad2/attachment.html>


More information about the Hardwarehacking mailing list