發表文章

目前顯示的是 11月, 2021的文章

DHT11+OLED+IFTTT+LINE-notity-micropython

圖片
  DHT11+OLED+LINE-notity-micropython 前言 這次要來實驗菜市場傳感器😂-DHT11在OLED上顯示並且在LINE上通知 溫濕度。 接線 關於 DHT11/12 往 這裡 走         OLED 往 這裡 走 IFTTT申請和設定 https://ifttt.com 程式碼 import dht , ssd1306 , urequests , network , gc from machine import Pin , SoftI2C from time import sleep #wifi連線 def wifiConn ():     ssid = "---"     password = "-----"     wifi = network . WLAN ( network . STA_IF )     wifi . active ( True )     wifi . connect ( ssid , password )     while wifi . isconnected () == False :         pass     print ( "connect successful!" )     print ( "IP: {} " . format ( wifi . ifconfig ())) #偵測溫濕度 def detectDHT ():     global d11     d11 = dht . DHT11 ( Pin ( 5 ))     d11 . measure ()     temp = d11 . temperature ()     hum = d11 . humidity ()     return temp , hum #OLED顯示 def ...