Skip to content

Latest commit

 

History

History

micropython

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

MicroPython examples

Requirements

  • MicroPython build from here

Installing MicroPython modules

I've used the REPL and upip to put the dependencies on the board. If you are using e.g. Thonny, connect to the REPL and run Python code to join a wifi network from the board. Then:

import upip
upip.install('micropython-umqtt.robust')
upip.install('micropython-umqtt.simple')

The modules will be installed to /lib on the board. You can also use e.g. ampy to copy the modules onto the board.

ampy -p /dev/cu.usbmodem11301 mkdir lib
ampy -p /dev/cu.usbmodem11301 put ahtx0.py lib/ahtx0.py

Another option is to use mpremote, the official MicroPython command-line tool.

Programs

  • main.py will run a series of simple tests on the LEDs.
  • cheerlights-demo.py will display the Cheerlights colour on an ongoing basis. Needs to be edited with valid Wifi network values for your network.
  • aht20-test.py reads and prints out values from an Adafruit AHT20 Temperature and Humidity sensor connected to the I2C port.

More information