Skip to content
Snippets Groups Projects
Commit 7e484119 authored by Tarik Graba's avatar Tarik Graba :scream_cat: Committed by Samuel Tardieu
Browse files

[python] i2c controller bus as a parameter

parent 9afc70f5
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@ from typing import Any, Optional
class Controller:
I2C_BUS = 8
I2C_ADDR = 0x57
WHO_AM_I = 0x0F
......@@ -14,7 +13,8 @@ class Controller:
ENCODER_TICKS = 0x32
STATUS = 0x36
def __init__(self):
def __init__(self, i2cbus=8):
self.I2C_BUS = i2cbus
self.i2c = smbus.SMBus(self.I2C_BUS)
def _read(self, command, n, unpack_spec) -> tuple:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment