From 01eb23f3dee81123bacca1d307a8483f92fd47e0 Mon Sep 17 00:00:00 2001 From: Can Altineller Date: Tue, 19 Nov 2024 02:34:20 +0300 Subject: [PATCH] fix --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.md b/README.md index 6e4eea1..89040f3 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,50 @@ Qwiic cables are a popular choice for connecting various sensors and actuators t Create a file named `haton.py` under `$HOME\bin` and put the code below inside it +
+
+

+#!/usr/bin/env python
+import string
+import struct
+import sys
+import time
+
+from smbus2 import SMBus
+
+with SMBus(1) as bus:
+
+    TCA6408_OUTPUT = 0x01
+    TCA6408_CONFIGURATION = 0x03
+    TCA6406_ADDRESS = 0x20
+
+    # PSEL_3V3_A    P0  0x01
+    # PSEL_3V3_B    P1  0x02
+    # SERIAL_RX_ON  P2  0x04
+    # SERIAL_TX_ON  P3  0x08
+    # PSEL_LIDAR    P4  0x10
+    # LIDAR_TX_ON   P5  0x20
+    # LIDAR_PWM_ON  P6  0x40
+
+    try:
+        bus.write_byte_data(TCA6406_ADDRESS, TCA6408_CONFIGURATION, 0x0)
+        bus.write_byte_data(TCA6406_ADDRESS, TCA6408_OUTPUT, 0x73)
+    except IOError as e:
+        print('IOError: %s' % e)
+
+
+        
+
+ + + + +
+ ```python #!/usr/bin/env python import string