Skip to content

Instantly share code, notes, and snippets.

@MZachmann
Last active February 22, 2018 14:12
Show Gist options
  • Save MZachmann/5abf24110632ac2db0b0ed6990c3b5c4 to your computer and use it in GitHub Desktop.
Save MZachmann/5abf24110632ac2db0b0ed6990c3b5c4 to your computer and use it in GitHub Desktop.
Create boot.py for a Pycom LoPy
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