from machine import I2C, Pin
import ssd1306
from time import sleep
import time
import lm75a
from max6675 import MAX6675
oled_width = 128
oled_height = 64
i2c=I2C(0, scl=Pin((17)), sda=Pin((16)))
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)
oled.fill(0)
oled.show()
oled.text('Hello', 0, 0)
oled.show()
time.sleep(1)
sensor1 = lm75a.LM75A(i2c)
sck = Pin(0, Pin.OUT)
so = Pin(1, Pin.IN)
cs = Pin(2, Pin.OUT)
sensor2 = MAX6675(sck, cs , so)
# Continuous measurement
while True:
temp1=sensor1.temp()
temp2=sensor2.read()
print('Temp1:' + str(temp1) + 'C, Temp2:' + str(temp2) + 'C')
oled.fill(0)
oled.text('Temp1:' + str(temp1) + 'C', 0, 20)
oled.text('Temp2:' + str(temp2) + 'C', 0, 30)
oled.show()
time.sleep(1)