Overview of MicroPython

What is MicroPython?

MicroPython is a tiny open-source Python programming language interpreter that runs on small embedded development boards. With MicroPython you can write clean and simple Python code to control hardware instead of having to use complex low-level languages like C or C++ (what Arduino uses for programming).

The simplicity of the Python programming language makes MicroPython an excellent choice for beginners who are new to programming and hardware. However, MicroPython is also quite full-featured and supports most of Python's syntax so even seasoned Python veterans will find MicroPython familiar and fun to use.
 
Beyond its ease of use MicroPython has some unique features that set it apart from other embedded systems:
  • Interactive REPL, or read-evaluate-print loop
    This allows you to connect to a board and have it execute code without any need for compiling or uploading--perfect for quickly learning and experimenting with hardware!
  • Extensive software library
    Like the normal Python programming language, MicroPython is 'batteries included' and has libraries built in to support many tasks. For example parsing JSON data from a web service, searching text with a regular expression, or even doing network socket programming is easy with built-in libraries for MicroPython.
  • Extensibility
    For advanced users, MicroPython is extensible with low-level C/C++ functions so you can mix expressive high-level MicroPython code with faster low-level code when you need it.

What can MicroPython do?

Almost anything you can imagine! Just like an Arduino board, MicroPython can control hardware and connected devices. You can control GPIO pins to blink lights, read switches, and more. You can drive PWM outputs for servos, LEDs, etc. or read analog sensors with an analog to digital converter. Talking to I2C or SPI devices is easy too, and you'll even find network & WiFi support on some boards. MicroPython even has libraries for controlling other hardware like NeoPixels and LED strips, tiny OLED displays, and more.
In short, MicroPython can do a lot!

What hardware supports MicroPython?

Be sure to check the MicroPython website to see the latest information on supported boards.

These boards support MicroPython in various ways:
  • pyboard
    This is the first MicroPython board and has very complete support for the language and hardware peripherals. This board comes to you with MicroPython running on it so you can get started using it immediately without any setup. Check out the pyboard documentation for more details on its capabilities.
  • ESP8266
    MicroPython support for the popular ESP8266 WiFi microcontroller is excellent. With MicroPython on ESP8266, you can access peripherals like GPIO, ADC, PWM, and I2C/SPI devices. In addition, WiFi & internet access is available and well supported. There's even a web-based REPL that allows you to run MicroPython code on the ESP8266 through your web browser! Check out the ESP8266 MicroPython documentation and the MicroPython ESP8266 FAQ forum page for more information. If you're looking for an inexpensive and easy board to start with MicroPython the ESP8266 is a great option.
  • SAMD21-based Boards
    Atmel SAMD21-based boards like the Feather M0 and Arduino Zero can use an in-development SAMD21 MicroPython port. See the MicroPython SAMD21 guide for more information on MicroPython with these boards.
  • WiPy
    The WiPy is another MicroPython board with WiFi and great support. Pycom is the company behind the WiPy board and they provide a nice integrated development environment to load and run MicroPython code on their boards. Be sure to see the WiPy page on Pycom's website for more information about the board's capabilities, in particular note the board currently doesn't support floating-point calculations.
  • BBC micro: bit
    The BBC micro: bit has great support for MicroPython and a very nice set of tools to write and upload code. With MicroPython on the micro: bit you can access the board's onboard peripherals including its LEDs, accelerometer, GPIO, radio, and more. Check out the official micro: bit MicroPython documentation for more details.
  • Teensy 3.x
    The Teensy 3.x series of microcontrollers have an early port of MicroPython available. Be aware you might need to be familiar with building firmware and compiling code to use this port as there aren't pre-made images available. This port of MicroPython is also a bit less mature compared to other boards but can still access basic peripherals like GPIO on the board. If you're looking at using MicroPython on a Teensy you'll want to check out the Teensy forums to learn more about what's possible in the current port.
See the MicroPython GitHub repository for more information on other supported boards & platforms.

Post a Comment

0 Comments