make examples consistent
This commit is contained in:
parent
686e623326
commit
afcbc75b0b
@ -6,13 +6,13 @@ This example was adapted from one written by Les Pounder for Tom's Hardware: htt
|
|||||||
|
|
||||||
import network
|
import network
|
||||||
import requests
|
import requests
|
||||||
from secrets import SSID, PASSWORD
|
from secrets import WIFI_SSID, WIFI_PASSWORD
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
# connect to wifi
|
# connect to wifi
|
||||||
wlan = network.WLAN(network.STA_IF)
|
wlan = network.WLAN(network.STA_IF)
|
||||||
wlan.active(True)
|
wlan.active(True)
|
||||||
wlan.connect(SSID, PASSWORD)
|
wlan.connect(WIFI_SSID, WIFI_PASSWORD)
|
||||||
while wlan.isconnected() is False:
|
while wlan.isconnected() is False:
|
||||||
print('Waiting for connection...')
|
print('Waiting for connection...')
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|||||||
@ -5,13 +5,13 @@ You will need to add your wireless SSID and password to secrets.py (and save thi
|
|||||||
|
|
||||||
import network
|
import network
|
||||||
import requests
|
import requests
|
||||||
from secrets import SSID, PASSWORD
|
from secrets import WIFI_SSID, WIFI_PASSWORD
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
# connect to wifi
|
# connect to wifi
|
||||||
wlan = network.WLAN(network.STA_IF)
|
wlan = network.WLAN(network.STA_IF)
|
||||||
wlan.active(True)
|
wlan.active(True)
|
||||||
wlan.connect(SSID, PASSWORD)
|
wlan.connect(WIFI_SSID, WIFI_PASSWORD)
|
||||||
while wlan.isconnected() is False:
|
while wlan.isconnected() is False:
|
||||||
print('Waiting for connection...')
|
print('Waiting for connection...')
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
SSID = 'ssid_goes_here'
|
WIFI_SSID = 'ssid_goes_here'
|
||||||
PASSWORD = 'password_goes_here'
|
WIFI_PASSWORD = 'password_goes_here'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user