Skip to content

Commit 35b5926

Browse files
Change I2C bus
1 parent 56d5d70 commit 35b5926

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/pi/manipulators/manipulators/manipulator_dry_run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
from smbus2 import SMBus, i2c_msg
44

5+
I2C_BUS = 6
56
ADDRESS = 0x20
67

78

89
def main() -> None:
9-
with SMBus(1) as bus:
10+
with SMBus(I2C_BUS) as bus:
1011
while True:
1112
print('on')
1213
write_all = i2c_msg.write(ADDRESS, [0x06, 0b00000000])

src/pi/manipulators/manipulators/manipulator_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from rov_msgs.msg import Manip
88

9+
I2C_BUS = 6
910
ADRRESS = 0x20
1011
CMD_BYTE = 0x06
1112

@@ -23,7 +24,7 @@ def __init__(self) -> None:
2324
parameters=[('left', Parameter.Type.INTEGER), ('right', Parameter.Type.INTEGER)],
2425
)
2526

26-
self.i2c = SMBus(1)
27+
self.i2c = SMBus(I2C_BUS)
2728
self.state = 0
2829

2930
def manip_callback(self, message: Manip) -> None:

0 commit comments

Comments
 (0)