15 lines
376 B
Python
15 lines
376 B
Python
|
import smbus
|
||
|
|
||
|
bus = smbus.SMBus(1) # I2C-Bus-Nummer
|
||
|
address = 8 # Arduino-Geräteadresse
|
||
|
|
||
|
while True:
|
||
|
data = []
|
||
|
for i in range(8):
|
||
|
buf = bus.read_i2c_block_data(address, i*4, 4) # 4 Bytes (32 Bit) lesen
|
||
|
val = int.from_bytes(buf, byteorder='little') # Bytes in Integer-Wert konvertieren
|
||
|
data.append(val)
|
||
|
|
||
|
# Daten verarbeiten
|
||
|
print(data)
|