Skip to content

Commit 095ce86

Browse files
committed
Add delay to allow Arduino to initialize
1 parent 5e8f224 commit 095ce86

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scan.py

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
from pymate.matenet import MateNET, MateNETPJON, MateDevice
88
import settings
9+
import serial
10+
import logging
11+
import time
12+
13+
#log = logging.getLogger('mate')
14+
#log.setLevel(logging.DEBUG)
15+
#log.addHandler(logging.StreamHandler())
916

1017
print("MATE Bus Scan")
1118

@@ -18,6 +25,9 @@
1825
# PJON is more reliable, so we don't need to retry packets
1926
bus.RETRY_PACKET = 0
2027

28+
# Time for the Arduino to boot (connecting serial may reset it)
29+
time.sleep(1.0)
30+
2131
else:
2232
bus = MateNET(settings.SERIAL_PORT)
2333

0 commit comments

Comments
 (0)