3

I got MINDSTORMS EV3 for my son and me. We installed Python (ev3dev) and ii seems to be running very slowly. I tried setting up the classic LEGO ev3g (block code), and that seems to run fine.

Are we doing something wrong or is Python very slow on MINDSTORMS?

Please help!

Example:

Simple program - display count and loop 100 times

Python: ~1.5s

ev3g: ~0.15s

Edit:

#!/usr/bin/env pybricks-micropython

from pybricks.hubs import EV3Brick
from pybricks.tools import wait, StopWatch
    
ev3 = EV3Brick()
ev3.speaker.beep()
timer = StopWatch()
    
for x in range(0, 100):
    ev3.screen.print(str(x) + ':' + str(timer.time()))
  
wait(5000)

This on the screen the last line displayed is 99:1113

this takes just over ~ 1.1s to loop 100 times

3
  • 5
    Welcome to Bricks.SE. Can you post the python source code?
    – chicks
    Dec 16, 2020 at 3:46
  • @chicks sorry for the delay. I have added the code for the python end. nothing fancy. Any idea why it is so slow?
    – Ishey4
    Dec 28, 2020 at 20:05
  • We cannot post our answer at the moment, we are voting to reopen the question so that it can be answered. And this is actually the comments section. Dec 30, 2020 at 8:18

1 Answer 1

2

Printing text in pybricks-micropython on ev3dev has known performance issues, so we don't recommend doing that in a loop. The trade off is that, unlike ev3-g, you can also print in other languages that don't use Latin scripts like Chinese and Russian. Most other things should run much faster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.