* [[:|Wiki Home]]
* [[:cheat_sheet|Cheat Sheet]]
* [[:compiling_on_virtualbox|Precompiled virtual tools]]
* [[:carambola_where_to_start|Where to start]]
* [[:carambola_connecting|Connecting to carambola]]
* [[:carambola_using_and_customizing|Using and Customizing]]
* [[:carambola_demo_projects|Demo projects/examples]]
* [[:carambola_hardware|Hardware]]
== Setup ==
At compile time add "python-smbus" package.
== Example ==
Let's read acceleration data from LIS302L accelerometer:
from smbus import SMBus
bus = SMBus(0)
addr = 0x1d
# enable the accelerometer by setting CTRL_REG_1 (0x20) appropriately
bus.write_byte_data(addr, 0x20, (0b0100 << 4 | 0b0111))
while True:
print bus.read_byte_data(addr, 0x29) # print x axis