There are a few I2C coding examples on the web; since my BB image includes python and geany, I've written the I2C code in Python and can edit and test it on the board. Much faster than an edit-compile-upload-test cycle.
Here's the code:
import i2c, time extender = i2c.I2C_device(0x20) extender.begin_transmission() extender.send(chr(0)) time.sleep(5) for count in range(0, 16): extender.send(chr(count)) time.sleep(0.5) extender.end_transmission()
2 comments:
I am currently working on a project using pandaboard, a platform similar to beagleboard, and need to use I2C as well. Did you use some sort of library for the i2c or did you write it yourself?
Can i use the i2c.h library? example the i2c_SMbus_write_byte(addr, command, data). There is 3 module of I2C, I2C0, I2C1 and I2C3 on the board, How I can link the device driver /dev/i2c-1 to module I2C1.
Post a Comment