Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ If you want to make your robot speak, you can use the ``Sound.speak`` method:
Make sure to check out the `User Resources`_ section for more detailed
information on these features and many others.

Using Micropython
-----------------

Normal Python too slow? Try `Micropython`_ if it supports the features your
project needs.

User Resources
--------------

Expand Down Expand Up @@ -236,12 +242,9 @@ but this library is compatible only with Python 3.
.. _ev3python.com: http://ev3python.com/
.. _FAQ: http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/faq.html
.. _our FAQ page: FAQ_
.. _ev3dev-lang-python: https://github.com/rhempel/ev3dev-lang-python
.. _our Issues tracker: https://github.com/rhempel/ev3dev-lang-python/issues
.. _our Issues tracker: https://github.com/ev3dev/ev3dev-lang-python/issues
.. _EXPLOR3R: demo-robot_
.. _demo-robot: http://robotsquare.com/2015/10/06/explor3r-building-instructions/
.. _demo programs: demo-code_
.. _demo-code: https://github.com/rhempel/ev3dev-lang-python/tree/master/demo
.. _robot-square: http://robotsquare.com/
.. _Python 2.x: python2_
.. _python2: https://docs.python.org/2/
Expand All @@ -254,3 +257,4 @@ but this library is compatible only with Python 3.
.. _ev3dev Visual Studio Code extension: https://github.com/ev3dev/vscode-ev3dev-browser
.. _Python + VSCode introduction tutorial: https://github.com/ev3dev/vscode-hello-python
.. _nano: http://www.ev3dev.org/docs/tutorials/nano-cheat-sheet/
.. _Micropython: http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/micropython.html
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.. toctree::
:maxdepth: 3

micropython
upgrading-to-stretch
spec
rpyc
Expand Down
45 changes: 45 additions & 0 deletions docs/micropython.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Using python-ev3dev with MicroPython

The core modules of this library are shipped as a module for [MicroPython](https://micropython.org/),
which is faster to load and run on the EV3. If your app only requires functionality supported on
MicroPython, we recommend you run your code with it for improved performance.

## Module support

```eval_rst
============================== =================
Module Support status
============================== =================
`ev3dev2.button` ️️✔️
`ev3dev2.control` [1]_ ⚠️
Comment thread
dwalton76 marked this conversation as resolved.
Resolved
`ev3dev2.display` ❌
`ev3dev2.fonts` [2]_ ⚠️
`ev3dev2.led` ✔️
`ev3dev2.motor` ✔️
`ev3dev2.port` ✔️
`ev3dev2.power` ✔️
`ev3dev2.sensor.*` ✔️
`ev3dev2.sound` ✔️
`ev3dev2.unit` ✔️
`ev3dev2.wheel` ✔️
============================== =================
.. [1] Untested/low-priority, but some of it might work.
.. [2] It might work, but isn't useful without ``ev3dev2.display``.
```

## Differences from standard Python (CPython)

See [the MicroPython differences page](http://docs.micropython.org/en/latest/genrst/index.html) for language information.

### Shebang

You should modify the first line of your scripts to replace "python3" with "micropython":

```
#!/usr/bin/env micropython
```

### Running from the command line

If you previously would have typed `python3 foo.py`, you should now type `micropython foo.py`.