This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 11.製作數位溫溼度計 (DHT22感測器) | |
# DHT22: D7(GPIO13) | |
# 加上 Try-Except 例外處理。 | |
# 加上 讀取溫溼度成功,LED閃一下。 | |
# https://thingspeak.com/channels/890086 | |
from machine import Pin | |
import dht | |
import time | |
import urequests as req |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 11.製作數位溫溼度計 (DHT22感測器) | |
# DHT22: D7(GPIO13) | |
# 加上 Try-Except 例外處理。 | |
# 加上 讀取溫溼度成功,LED閃一下。 | |
from machine import Pin | |
import dht | |
import time | |
print('dht22v4.py') | |
pinDHT22 = Pin(13, Pin.IN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 11.製作數位溫溼度計 (DHT22感測器) | |
# DHT22: D7(GPIO13) | |
# 加上 Try-Except 例外處理。 | |
from machine import Pin | |
import dht | |
import time | |
print('dht22v3.py') | |
pinDHT22 = Pin(13, Pin.IN) | |
d = dht.DHT22(pinDHT22) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 11.製作數位溫溼度計 (DHT22感測器) | |
# DHT22: D7(GPIO13) | |
# 使用函數呼叫方式 | |
from machine import Pin | |
import dht | |
import time | |
print('dht22v2.py') | |
pinDHT22 = Pin(13, Pin.IN) | |
d = dht.DHT22(pinDHT22) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 11.製作數位溫溼度計 (DHT22感測器) | |
# DHT22: D7(GPIO13) | |
from machine import Pin | |
import dht | |
import time | |
print('dht22v1.py') | |
pinDHT22 = Pin(13, Pin.IN) | |
d = dht.DHT22(pinDHT22) | |
time.sleep(3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
country=TW | |
network={ | |
ssid="無線基地台名稱1" | |
psk="無線基地台密碼" | |
key_mgmt=WPA-PSK | |
} | |
network={ | |
ssid="無線基地台名稱2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: mypython | |
# Required-Start: $syslog $network | |
# Required-Stop: $syslog $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mypython | |
# Description: starts mypython using start-stop-daemon | |
### END INIT INFO |