openroberta-lab icon indicating copy to clipboard operation
openroberta-lab copied to clipboard

Edison - using repeat x times loop

Open Thorlogy opened this issue 1 year ago • 4 comments

Describe the bug

  • A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Open Roberta Lab'
  2. Click on 'Edison'
  3. Code the "repeat x times loop"
  4. Download to Edison
  5. See error

Expected behavior

  • A clear and concise description of what you expected to happen.

Screenshots image

image

Device information

  • Type laptop
  • OS: Mac
  • Browser chrome

Thorlogy avatar Feb 23 '24 14:02 Thorlogy

Please be more precise and send a screenshot of the generated source code (Source Code View) of line 12

bjost2s avatar Feb 23 '24 15:02 bjost2s

image

here you go.

Thorlogy avatar Feb 23 '24 15:02 Thorlogy

I tried the following code in the EdPy-IDE and it works:

import Ed

Ed.EdisonVersion = Ed.V1

Ed.DistanceUnits = Ed.TIME
Ed.Tempo = Ed.TEMPO_MEDIUM

#--------Your code below-----------

for x in range(10):
    Ed.RightLed(Ed.ON)

Using this code in our source code editor, generates an error of the Edison compiler we are using:

Achtung

Das Programm kann nicht auf dem Roboter oder in der Simulation ausgeführt werden. Das Program kann nicht übersetzt werden. Die Fehlermeldung ist:
{"error": true, "messages": ["ERR: file:10:0: Syntax Error, FOR code too complex for Ed.Py"], "wavFilename": null}

A possible reason: our Edison compiler is outdated. BTW: the program can be executed in the simulation. We should change the error message.

rbudde avatar Feb 24 '24 11:02 rbudde

The "old" (and origin) Edison Python compiler works, but unfortunately only with Python 2. That's why we changed it here to a python 3 compatible version. Seem like the issue with "too complex" comes from this compiler: https://github.com/thonny/thonny-edison One workaround would be, to switch back to the Python 2 version or trying to fix the thonny solution. Last year the information from Edison was, that they are not working on a Python 3 compatible compiler for Python.

bjost2s avatar Feb 26 '24 19:02 bjost2s

The implemented solution is to use edison's compiler directly. In conversation with the people at edison, it turned out that we are allowed to use their API for this purpose.

bjost2s avatar Jul 23 '24 12:07 bjost2s

"Run on Edison" returns compiler error: Permission denied

Device infos

  • Type: Desktop
  • OS: Windows 10
  • Browser: Chrome, Brave, Edge

Image

AHberta avatar Jul 24 '24 11:07 AHberta

Tested and works fine on Windows also! Thanx ;)

AHberta avatar Jul 25 '24 13:07 AHberta