bh3a-Icetruck-Challenge-1-3/Pi-py-Code/tmp_0x09.py

16 lines
294 B
Python
Raw Permalink Normal View History

2024-06-27 11:14:28 +02:00
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))