kopia lustrzana https://github.com/peterhinch/micropython-samples
ESP8266 conn.py added
rodzic
a820755f5d
commit
c0ea6bad60
|
@ -0,0 +1,23 @@
|
|||
# Connect in station mode. Use saved parameters if possible to save flash wear
|
||||
|
||||
import network
|
||||
import utime
|
||||
|
||||
use_default = True
|
||||
ssid = 'my_ssid'
|
||||
pw = 'my_password'
|
||||
|
||||
sta_if = network.WLAN(network.STA_IF)
|
||||
if use_default:
|
||||
secs = 5
|
||||
while secs >= 0 and not sta_if.isconnected():
|
||||
utime.sleep(1)
|
||||
secs -= 1
|
||||
|
||||
# If can't use default, use specified LAN
|
||||
if not sta_if.isconnected():
|
||||
sta_if.active(True)
|
||||
sta_if.connect(ssid, pw)
|
||||
while not sta_if.isconnected():
|
||||
utime.sleep(1)
|
||||
|
|
@ -39,6 +39,8 @@ the same topic. Measures the round-trip delay. Adapt to suit your server address
|
|||
QOS (quality of service, 0 and 1 are supported). After 100 messages reports maximum and
|
||||
minimum delays.
|
||||
|
||||
conn.py Connect in station mode using saved connection details where possible
|
||||
|
||||
## Rotary Incremental Encoder
|
||||
|
||||
Classes for handling incremental rotary position encoders. Note that the Pyboard timers can
|
||||
|
|
Ładowanie…
Reference in New Issue