arduino/lab-micropython-editor

Alvik does not run reliably from MicroPython

raysalemi opened this issue · 1 comments

I have a program in MicroPython that does not run reliably. The first time I start, I can press the Run triangle and the program will run. After that it does not get past the alvik.begin() statement.

Here is the program:

print("Go Go")
alvik = ArduinoAlvik()
alvik.begin()
print("Alvik begin")


while not alvik.get_touch_cancel():
  print("running")
  alvik.set_wheels_speed(10,10)
  color = alvik.get_color_label()
  print(color)
  if (color == 'RED'):
      turn_left(alvik)
  if (color == 'GREEN'):
      turn_right(alvik)

Here the output when I press the Run Button:

MicroPython v1.22.2 on 2024-02-22; Arduino Nano ESP32 with ESP32S3
Type "help()" for more information.
>>> 
raw REPL; CTRL-B to exit
>OKGo Go

The program prints Go Go but does not get past Alvik begin.

Solved it.

The program needs alvik.stop() at the end.