-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (26 loc) · 807 Bytes
/
Copy pathmain.py
File metadata and controls
27 lines (26 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# main.py
#
# Place this in the root filesystem of the device, it
# examines config.py to determine whether to autostart
# printXIAO on device startup and hard reboots.
print('PrintXIAO loader')
from time import sleep_ms
try:
from config import config
except ModuleNotFoundError:
print('Cannot find config.py')
print('Copy "config-default.py" to "config.py" and edit as needed')
else:
if config.debug is None:
import printXIAO
elif config.debug > 0:
print('Autostart: ',end='')
for i in range(config.debug,0,-1):
print('{}'.format(i),end='')
sleep_ms(500)
print('.',end='')
sleep_ms(500)
print('now')
import printXIAO
# Otherwise, just drop out to the repl prompt
print('Debug mode; not starting')