Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edison - using repeat x times loop #1632

Closed
Thorlogy opened this issue Feb 23, 2024 · 7 comments
Closed

Edison - using repeat x times loop #1632

Thorlogy opened this issue Feb 23, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Thorlogy
Copy link

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
@bjost2s
Copy link
Contributor

bjost2s commented Feb 23, 2024

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

@Thorlogy
Copy link
Author

image

here you go.

@rbudde
Copy link
Contributor

rbudde commented Feb 24, 2024

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.

@bjost2s
Copy link
Contributor

bjost2s commented Feb 26, 2024

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 bjost2s self-assigned this Jul 1, 2024
@bjost2s bjost2s added the bug Something isn't working label Jul 1, 2024
bjost2s added a commit that referenced this issue Jul 23, 2024
@bjost2s
Copy link
Contributor

bjost2s commented Jul 23, 2024

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.

@AHberta
Copy link

AHberta commented Jul 24, 2024

"Run on Edison" returns compiler error: Permission denied

Device infos

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

Image

@AHberta
Copy link

AHberta commented Jul 25, 2024

Tested and works fine on Windows also! Thanx ;)

@bjost2s bjost2s closed this as completed Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants