Skip to content

Commit 02f4cfc

Browse files
committed
fix: line_follower starting too early
fix: modulino example should raise ImportError when the lib is not available
1 parent 00e45c3 commit 02f4cfc

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

examples/arduino-runtime/line_follower.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ def setup():
4747

4848

4949
def loop():
50-
while not alvik.get_touch_cancel():
51-
run_line_follower(alvik)
52-
5350
while not alvik.get_touch_ok():
5451
alvik.left_led.set_color(0, 0, 1)
5552
alvik.right_led.set_color(0, 0, 1)
5653
alvik.brake()
5754
sleep_ms(100)
5855

56+
while not alvik.get_touch_cancel():
57+
run_line_follower(alvik)
58+
5959

6060
def cleanup():
6161
alvik.stop()

examples/communication/modulino.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
from arduino_alvik import ArduinoAlvik
22
from time import sleep_ms
3-
import sys
43

54

65
try:
76
from modulino import ModulinoPixels
87
except ImportError as e:
9-
print("ImportError: ModulinoPixels not installed")
10-
sys.exit(-1)
8+
print("\nImportError: ModulinoPixels not installed")
9+
raise e
1110

1211
alvik = ArduinoAlvik()
1312
alvik.begin()

0 commit comments

Comments
 (0)