from machine import Pin, I2C, RTC, ADC
led = Pin(2, Pin.OUT, value=1)
import machine
import time
import bmp280
import dht
import TM1637
import DS1307
i2c=I2C(sda=Pin(5), scl=Pin(4))
ds=DS1307.DS1307(i2c)
adc = ADC(0)
rtc = RTC()
b = bmp280.BMP280(i2c)
dht11 = dht.DHT11(Pin(14))
dir_pin=Pin(4, Pin.IN, Pin.PULL_UP)
def getDir():
dir_pin=Pin(4, Pin.IN, Pin.PULL_UP)
dir = dir_pin()
return dir
tm=TM1637.TM1637(dio=Pin(13), clk=Pin(12))
def init():
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
t = (adc.read() + adc.read()) // 2
if t > 450:
for i in range(4):
tm.showDP(i)
time.sleep_ms(500)
tm.showDP(i, 0)
init()
o