This is the home page for a __MicroPython Tutorial__. Here's the URL of the server: %%url http://service.robots.org.nz/wiki/ %% !! Documentation The complete documentation for Python and MicroPython (as used on microcontrollers) is available here: * [Python documentation|https://docs.python.org/3/] ** [Beginner's Guide|https://wiki.python.org/moin/BeginnersGuide] * [MicroPython documentation|https://docs.micropython.org/en/latest/] ** [Language Reference|https://docs.micropython.org/en/latest/reference/index.html] ** [Libraries Reference|https://docs.micropython.org/en/latest/library/index.html] ** [Glossary of MicroPython terms|https://docs.micropython.org/en/latest/reference/glossary.html] * There is also a complete page on this wiki about [MicroPython] !! Exercises * [MicroPython Tutorial Exercise 1|MicroPythonTutorialExercise01]: main.py * [MicroPython Tutorial Exercise 2|MicroPythonTutorialExercise02]: blocks * [MicroPython Tutorial Exercise 3|MicroPythonTutorialExercise03]: functions * [MicroPython Tutorial Exercise 4|MicroPythonTutorialExercise04]: classes * [MicroPython Tutorial Exercise 5|MicroPythonTutorialExercise05]: using classes Additional exercises: * [Objects and Names|MicroPythonTutorialObjectsAndNames] * [Scope|MicroPythonTutorialScope]. * [Exception Handling|MicroPythonTutorialExceptionHandling]. * [String Formatting|StringFormatting]. !! Starting Point We begin with a {{main.py}} file (sometimes called a "script") defining a __module__ called "main" and containing just a single comment line: %%filename main.py %% %%python {{{ # do something intelligent here }}} %% The file {{main.py}} is special in MicroPython, in the sense that when you power-on the device and/or press the reset button, the {{main.py}} file is executed. It's the ''entry point'' for executing any application in Python. __Next:__ [MicroPython Tutorial Exercise 2|MicroPythonTutorialExercise02]: blocks