RpiMakers Python On Microcontrollers May 12 2018
RpiMakers Python On Microcontrollers May 12 2018
RpiMakers Python On Microcontrollers May 12 2018
ESP8266 ESP32
Adafruit ARM
micro:bit based boards
PyBoard
Python on Microcontrollers
• Higher productivity than C
• Shorter iterations
• Faster to learn than C/C++
Python on Microcontrollers
• Less efficient use of RAM, ROM, CPU
• Fewer drivers than Arduino C
Demo: Using the Python REPL
Micropython
Interpreter
Putty (runs
micropython
Putty talks directly to micropython REPL
programs)
• manually run a program
Demo 1: “hello world”
Demo 2: Control a LED
More REPL fun
Micropython
Interpreter
Ampy run (runs micropython
programs)
Node-RED
Sensor
Data
Dashboard
Light
Sensor
Data
Clock
Node-
Sensor RED
Data Dashboard
Light
Sensor
File System
put
Ampy main.py boot.py
• http://micropython.org/download
Solar weather station
Installing Micropython on ESP8266
Step 1. Install USB-> Serial Driver
• Install USB driver for board (WEMOS D1 mini) :
• https://wiki.wemos.cc/downloads
https://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/intro.html
Installing Micropython on ESP8266
Step 3. Install and Configure Putty
• Install Putty from
– https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
• Configure Putty:
Installing Micropython on ESP8266
Step 4. Install Ampy
• Tutorial
– https://github.com/adafruit/ampy
• Run Ampy:
– Ampy –pCOMx –d1 ls
– Ampy –pCOMx –d1 run <python file>
• Where COMx is USB comm port … e.g COM4. See Windows Device
Manager, in the Ports topic
3.3