A microcontroller unit is a CPU, memory modules, and I/O devices on a single chip. There are tens of billions of microcontrollers in world: they are everywhere from watches to cars. Developers program them mostly in C, since their tiny hardware resources make it very hard to use higher-level langauges such as Python. In 2014 the MicroPython project was started with the goal of making it possible to program microcontrollers in Python.
Was it hard to make Python work on a device with only 16 KB of RAM? Is MicroPython a Python dialect or is it a different language? I’ll start with the most important optimizations and the key differences in the language implementation to give you an idea of what MicroPython really is.
Most of us are not contributors to MicroPython though and it’s much more important for us to understand how Python coding for microcontrollers is different from, say, web development or scripting. What do you need to learn in order to program your mictrocontroller-based IoT devices? I’ll talk about several traits of Python coding for microcontrollers that make it different, but exciting to learn.