-
Notifications
You must be signed in to change notification settings - Fork 302
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
💻 Adding a button for Microbit #5249
Conversation
Adding a button that will take the user input and will generate a Micro-python code then will convert that code to hex and send it to the user for downloading.
for more information, see https://pre-commit.ci
…o Microbit-button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!!
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Hello @hasan-sh, Should i fix the conflict and push again? |
Yes you can! |
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Adding a button that that transpiles the Hedy code to Micro-python code and then sends it to the user for downloading.
The button is in class=hidden with id=saveMicrobitFilesContainer in templates/incl/editor-and-output.html
When the button is clicked sets the Microbit boolean to true and transpiles user code. The user code is saved in the Micro-bit folder. Then the saved code is converted to .hex and it is send to the user for downloading. At the end both files are deleted.
Created @app.route for generating and downloading the files in app.py
How to test
Follow these steps to verify this PR works as intended:
Set the button to not be hidden.
Click on the Run Micro bit button and a hex file should be downloaded automatically. Then the file can be uploaded here to check if the code is correct or directly saved to a Microbit via USB.
Checklist
Done? Check if you have it all in place using this list: (mark with x if done)
If you're unsure about any of these, don't hesitate to ask. We're here to help!