__[MicroPython]__ is a version of the [Python] programming language suitable for [microcontrollers].
Note that there is a TinyURL link to this page as: [https://tinyurl.com/mpy-rsrcs]
Also, there is a link from the [MicroPython home page|https://micropython.org/] that provides an invitation to the MicroPython Discord server.
!! Getting Started
__MicroPython__ is a version of the [Python] programming language designed for use on microcontrollers like the [ESP32], [STM32], [RP2040], etc. Installation instructions are available from the ''Quick Reference'' page for each microcontroller (sidebar links from the [Documentation|https://docs.micropython.org/en/latest/index.html] page), which is generally: downloading the distribution file and installing it over a USB connection.
Note that MicroPython on a microcontroller has what's effectively its own tiny file system (as a "[Pyboard]"), and there's not really much in the way of standardisation of how things are installed there. So if a library or function isn't defined in MicroPython itself (or, e.g., in Pimoroni's distribution of it), you can simply install the necessary files on your microcontroller, perhaps in its own or a 'lib' directory, and just be sure to manage your imports so your main.py can see the necessary files. It's not a lot more complicated than that.
I'd also recommend __[rshell|https://github.com/dhylands/rshell]__, which provides a command line into {{/pyboard}} where you can use commands like {{cp}} (copy), {{df}} (get filesystem info), {{rm}} (delete files), {{rsync}} (synchronise with a local directory), and {{edit}} (with vim being the default editor, but changeable). {{repl}} provides access to the Python REPL so you can execute your code. Highly recommended. The `rsync` feature alone is worth it, e.g., you can sync your installation with a local directory that can be maintained on github.
The following MicroPython distributions include "baked-in" support for many Pimoroni products:
* [Pimoroni MicroPython distribution for RP2040|https://github.com/pimoroni/pimoroni-pico#micropython]
* [Pimoroni MicroPython distribution for RP2350|https://github.com/pimoroni/pimoroni-pico-rp2350]
See also: [Pyboard]
!! MicroPython Language Documentation / General
* [MicroPython home page|https://micropython.org/]
* [MicroPython documentation page|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]
* [Awesome MicroPython|https://awesome-micropython.com/], a curated list of MicroPython libraries, frameworks, software and resources
!! Tutorials
__[[unvetted]__
* [MicroPython tutorials|https://docs.micropython.org/en/latest/search.html?q=tutorial] from micropython.org
* [MicroPython: An Intro to Programming Hardware in Python|https://realpython.com/micropython/] from RealPython
* [Introduction: Get Started with MicroPython|https://www.kevsrobots.com/learn/micropython/]
* [MicroPython tutorial for ESP32|https://docs.micropython.org/en/latest/esp32/tutorial/index.html]
!! Libraries & Resources
* [micropython-lib|https://github.com/micropython/micropython-lib/], a repository of packages designed to be useful for writing MicroPython applications
* [OpenMV MicroPython libraries|https://docs.openmv.io/library/index.html#python-standard-libraries-and-micro-libraries]
* [FuPy: MicroPython for FPGAs|https://nick.zoic.org/art/fupy-micropython-for-fpga/]
!! Tools, Hardware
* [rshell|https://github.com/dhylands/rshell], the Remote MicroPython shell
* [Mu Editor|https://codewith.mu/]
* [mpbuild|https://github.com/mattytrentini/mpbuild] builds MicroPython firmware in containers so you don't need to install any compiler toolchains or development tools
* [Redirect stdout to StringIO works in Python3, how in MicroPython?|https://forum.micropython.org/viewtopic.php?f=2&t=5442]
* [MicroPython ICM20948 Driver|https://micropython-icm20948.readthedocs.io/en/latest/api.html]
* [Zumo adapter for MicroPython Pyboard by MCHobby|https://www.pololu.com/blog/907/zumo-adapter-for-micropython-pyboard-by-mchobby]
* [Exploring ESP-NOW in MicroPython: A Learner’s Guide|https://www.donskytech.com/exploring-esp-now-in-micropython-a-learners-guide/]
* [Quick Reference for the Pyboard|https://docs.micropython.org/en/latest/pyboard/quickref.html]
! Installing MicroPython on Linux
To install MicroPython on Linux, where normally one would use Python (CPython) you need to install the machine library. This can be accomplished via:
{{{
sudo apt install micropython
}}}
! Has Tag of "MicroPython"
[{HasTagOf MicroPython}]
----
[{Tag Python MicroPython}]