Introduction to MicroPython
python running on tiny embedded boards
• new Python implementation based on Python 3

• a 32-bit ARM processor based development board
Kickstarter
Builtin functions and exceptions

	 •	 array – arrays of numeric data

	 •	 cmath – mathematical functions for complex numbers

	 •	 gc – control the garbage collector

	 •	 math – mathematical functions

	 •	 sys – system specific functions

	 •	 ubinascii – binary/ASCII conversions

	 •	 ucollections – collection and container types

	 •	 uerrno – system error codes

	 •	 uhashlib – hashing algorithms

	 •	 uheapq – heap queue algorithm

	 •	 uio – input/output streams

	 •	 ujson – JSON encoding and decoding

	 •	 uos – basic “operating system” services

	 •	 ure – simple regular expressions

	 •	 uselect – wait for events on a set of streams

	 •	 usocket – socket module

	 •	 ustruct – pack and unpack primitive data types

	 •	 utime – time related functions

	 •	 uzlib – zlib decompression

MicroPython-specific libraries
	 •	 btree – simple BTree database

	 •	 framebuf — Frame buffer manipulation

	 •	 machine — functions related to the hardware

	 •	 micropython – access and control MicroPython internals

	 •	 network — network configuration

	 •	 uctypes – access binary data in a structured way
• STM32F405RG microcontroller

• 168 MHz Cortex M4 CPU with hardware floating point

• 1024KiB flash ROM and 192KiB RAM

• Micro USB connector for power and serial communication

• Micro SD card slot, supporting standard and high capacity SD cards

• 3-axis accelerometer (MMA7660)

• Real time clock with optional battery backup

• 24 GPIO on left and right edges and 5 GPIO on bottom row, plus LED and switch GPIO available on bottom row

• 3x 12-bit analog to digital converters, available on 16 pins, 4 with analog ground shielding

• 2x 12-bit digital to analog (DAC) converters, available on pins X5 and X6

• 4 LEDs (red, green, yellow and blue)

• 1 reset and 1 user switch

• On-board 3.3V LDO voltage regulator, capable of supplying up to 250mA, input voltage range 3.6V to 16V

• DFU bootloader in ROM for easy upgrading of firmware
Examples
Kickstarter 2
Support for ESP8266
More examples
http://microbit.org/
£13
https://www.pycom.io/
£20-£50
• http://docs.micropython.org/

• https://forum.micropython.org/ 

• https://github.com/micropython


MicroPython Introduction PUSG July 2017

  • 1.
    Introduction to MicroPython pythonrunning on tiny embedded boards
  • 2.
    • new Pythonimplementation based on Python 3 • a 32-bit ARM processor based development board Kickstarter
  • 3.
    Builtin functions andexceptions • array – arrays of numeric data • cmath – mathematical functions for complex numbers • gc – control the garbage collector • math – mathematical functions • sys – system specific functions • ubinascii – binary/ASCII conversions • ucollections – collection and container types • uerrno – system error codes • uhashlib – hashing algorithms • uheapq – heap queue algorithm • uio – input/output streams • ujson – JSON encoding and decoding • uos – basic “operating system” services • ure – simple regular expressions • uselect – wait for events on a set of streams • usocket – socket module • ustruct – pack and unpack primitive data types • utime – time related functions • uzlib – zlib decompression MicroPython-specific libraries • btree – simple BTree database • framebuf — Frame buffer manipulation • machine — functions related to the hardware • micropython – access and control MicroPython internals • network — network configuration • uctypes – access binary data in a structured way
  • 4.
    • STM32F405RG microcontroller •168 MHz Cortex M4 CPU with hardware floating point • 1024KiB flash ROM and 192KiB RAM • Micro USB connector for power and serial communication • Micro SD card slot, supporting standard and high capacity SD cards • 3-axis accelerometer (MMA7660) • Real time clock with optional battery backup • 24 GPIO on left and right edges and 5 GPIO on bottom row, plus LED and switch GPIO available on bottom row • 3x 12-bit analog to digital converters, available on 16 pins, 4 with analog ground shielding • 2x 12-bit digital to analog (DAC) converters, available on pins X5 and X6 • 4 LEDs (red, green, yellow and blue) • 1 reset and 1 user switch • On-board 3.3V LDO voltage regulator, capable of supplying up to 250mA, input voltage range 3.6V to 16V • DFU bootloader in ROM for easy upgrading of firmware
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.