Last active
February 22, 2018 14:12
-
-
Save MZachmann/5abf24110632ac2db0b0ed6990c3b5c4 to your computer and use it in GitHub Desktop.
Create boot.py for a Pycom LoPy
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
def addmore() : | |
boottxt=''' | |
# boot.py -- run on boot-up | |
import os | |
import time | |
from network import WLAN | |
from machine import UART | |
uart = UART(0, 115200) | |
os.dupterm(uart) | |
wlan = WLAN() # get current object, without changing the mode | |
wlan.init(mode=WLAN.STA) | |
# change the line below to | |
# match your network ssid, security and password | |
wlan.connect('ssid', auth=(WLAN.WPA2, 'mypw'), timeout=5000)''' | |
with open('boot.py','w') as bt : | |
bt.write(boottxt) | |
bt.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment