Code: Select all
import machine
import sys, os, pyb
import time
pyb.usb_mode('VCP') # Virtual COM Port Only
if pyb.SDCard().present():
try:
os.mount(pyb.SDCard(), '/sd')
sys.path[1:1] = ['/sd','/sd']
os.chdir('/sd')
except Exception as e:
sys.print_exception(e)
print('Error mounting SD')
else:
print('SD Card not present')
pyb.main('/sd/main.py')
I only have a boot.py on the flash and all my other files on the SD card.
What am I doing wrong?