Skip to content

Commit 0582aee

Browse files
WasabiFandwalton76
authored andcommitted
Initial draft of MicroPython docs (ev3dev#611)
1 parent 830a6ff commit 0582aee

3 files changed

Lines changed: 54 additions & 4 deletions

File tree

‎README.rst‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ If you want to make your robot speak, you can use the ``Sound.speak`` method:
163163
Make sure to check out the `User Resources`_ section for more detailed
164164
information on these features and many others.
165165

166+
Using Micropython
167+
-----------------
168+
169+
Normal Python too slow? Try `Micropython`_ if it supports the features your
170+
project needs.
171+
166172
User Resources
167173
--------------
168174

@@ -236,12 +242,9 @@ but this library is compatible only with Python 3.
236242
.. _ev3python.com: http://ev3python.com/
237243
.. _FAQ: http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/faq.html
238244
.. _our FAQ page: FAQ_
239-
.. _ev3dev-lang-python: https://github.com/rhempel/ev3dev-lang-python
240-
.. _our Issues tracker: https://github.com/rhempel/ev3dev-lang-python/issues
245+
.. _our Issues tracker: https://github.com/ev3dev/ev3dev-lang-python/issues
241246
.. _EXPLOR3R: demo-robot_
242247
.. _demo-robot: http://robotsquare.com/2015/10/06/explor3r-building-instructions/
243-
.. _demo programs: demo-code_
244-
.. _demo-code: https://github.com/rhempel/ev3dev-lang-python/tree/master/demo
245248
.. _robot-square: http://robotsquare.com/
246249
.. _Python 2.x: python2_
247250
.. _python2: https://docs.python.org/2/
@@ -254,3 +257,4 @@ but this library is compatible only with Python 3.
254257
.. _ev3dev Visual Studio Code extension: https://github.com/ev3dev/vscode-ev3dev-browser
255258
.. _Python + VSCode introduction tutorial: https://github.com/ev3dev/vscode-hello-python
256259
.. _nano: http://www.ev3dev.org/docs/tutorials/nano-cheat-sheet/
260+
.. _Micropython: http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/micropython.html

‎docs/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.. toctree::
66
:maxdepth: 3
77

8+
micropython
89
upgrading-to-stretch
910
spec
1011
rpyc

‎docs/micropython.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Using python-ev3dev with MicroPython
2+
3+
The core modules of this library are shipped as a module for [MicroPython](https://micropython.org/),
4+
which is faster to load and run on the EV3. If your app only requires functionality supported on
5+
MicroPython, we recommend you run your code with it for improved performance.
6+
7+
## Module support
8+
9+
```eval_rst
10+
============================== =================
11+
Module Support status
12+
============================== =================
13+
`ev3dev2.button` ️️✔️
14+
`ev3dev2.control` [1]_ ⚠️
15+
`ev3dev2.display` ❌
16+
`ev3dev2.fonts` [2]_ ⚠️
17+
`ev3dev2.led` ✔️
18+
`ev3dev2.motor` ✔️
19+
`ev3dev2.port` ✔️
20+
`ev3dev2.power` ✔️
21+
`ev3dev2.sensor.*` ✔️
22+
`ev3dev2.sound` ✔️
23+
`ev3dev2.unit` ✔️
24+
`ev3dev2.wheel` ✔️
25+
============================== =================
26+
27+
.. [1] Untested/low-priority, but some of it might work.
28+
.. [2] It might work, but isn't useful without ``ev3dev2.display``.
29+
```
30+
31+
## Differences from standard Python (CPython)
32+
33+
See [the MicroPython differences page](http://docs.micropython.org/en/latest/genrst/index.html) for language information.
34+
35+
### Shebang
36+
37+
You should modify the first line of your scripts to replace "python3" with "micropython":
38+
39+
```
40+
#!/usr/bin/env micropython
41+
```
42+
43+
### Running from the command line
44+
45+
If you previously would have typed `python3 foo.py`, you should now type `micropython foo.py`.

0 commit comments

Comments
 (0)