first commit

This commit is contained in:
Souti
2025-03-06 11:09:58 +01:00
commit 11f7d440ff
330 changed files with 38306 additions and 0 deletions

21
i2cs.py Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/python
from smbus import SMBus
import time
bus = SMBus(1)
slaveAddress = 0x12
data_received_from_Arduino = ""
data_to_send_to_Arduino = "Hello Uno"
def StringToBytes(val):
retVal = []
for c in val:
retVal.append(c)
return retVal
bus.write_byte(slaveAddress,1)
time.sleep(0.2)
data_received_from_Arduino = bus.read_i2c_block_data(slaveAddress, 0, 12)
print(data_received_from_Arduino)