bh3a-Icetruck-Challenge-1-3/Pi-py-Code/tmp_0x09.py
2024-06-27 11:14:28 +02:00

16 lines
294 B
Python

import smbus
import time
bus = smbus.SMBus(1)
address = 0x09 # Arduino I2C Address
def get_temp(addr):
# request data
temp = (bus.read_byte(addr) - 75)
time.sleep(1)
return temp
if __name__ == '__main__':
print("temp of 0x09:",get_temp(address))