MicroPython – Python for Microcontrollers
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Spindler, Christine
MicroPython is an implementation of Python designed to run on microcontrollers and embedded systems. These devices don’t have many resources (CPU, RAM) and so it’s important to write efficient scripts. This talk shows how to make the most of your resources in MicroPython, and has some fun demos! MicroPython is a reimplementation of Python which is specifically designed to run on computing devices that have very few resources, such as CPU power, RAM and storage. Often when you write scripts in MicroPython you want to make the most of your available resources, and have code run as fast as possible (faster code usually saves power, which is important when running from a battery!) and there are certain ways of writing MicroPython code that are more efficient than others. In this talk I will go over the tricks and techniques for writing fast and efficient Python code in MicroPython. The talk will also include some hardware demos to show off these techniques.
 So, yeah, what is micro-python all about? Python, it's a re-implementation of Python 3. So it's aimed to be efficient to run on a microcontroller and in constrained systems. So it's not Python, as you know it from the desktop computer. It's Python as a re-implementation of it. There are a lot of different development platforms out there already that ship with micro-python pre-installed. So you have the official micro-python pieboards and some cameras that run micro-python as the optical recognition. OtherFruit has a circuit-python port of micro-python and they are doing a lot of hardware and supporting the community in quite some big effort. Then there's BBC Micro-Python, there's a company named PyCom so it's already quite a lot out there if you want to try it out. You can also try it out online on our homepage in a simulator. Micro-python had started about five years ago with a Kickstarter campaign. Damien George is the creator of it. He is an Australian physicist who was working at Cambridge at the time. He had the idea of putting Python on a microcontroller. So he ran this kick-start and turned out to be quite successful. So there was a lot of interest in having a high-level scripting language running to control low-level hardware. This was about five years ago and since then a lot has happened. Some of you might know the BBC Micro-Bit for example, which was given in the year 2016 to about a million children in the UK so that they learn teaching, that they learn Python in school with Micro-Python on the BBC Micro-Bit so they get interaction from hardware and software and the people think that might be quite some fun. Then there's been the first O'Reilly book from Niclas Toller, a programming with Micro-Python. Micro-Python is an open source project which is hosted on GitHub and it's about 7,500 stars so it's quite popular and it's growing. Also, Micro-Python has been into space. What Micro-Python aims to be is on the one side you want to have low-power applications. It wants to be small in size, in terms of code. It doesn't like to have a lot of storage space to run in and of course the most pressure time it wants to be fast. All this combined together, it's kind of more sufficient. Well, I'm going to speed this up a little bit. I want to do a little live demo today with the new Python D which is the second generation of the official Micro-Python PyBot. I have one here connected to my PC which runs as an access point because I made up my own little Wi-Fi to make sure that it's going to be working hopefully. So I have someone that supports me in the audience. Very good. And I'm going to log in through a web repel which you can see here. So I'm going to disconnect it again and connect. Can you all see that? It's going to ask me about the password and I'll actually connect it into the device. The gentleman in front has. I'm going to run a little code that I have prepared. First I'm going to read some sensors. Now you should see a blinking LED maybe. Not from over. And some noise. Some people might hear it and you can see it's reading sensors. So it's sending it back to my machine. And we're going to do some more fun stuff. Let's see. So now you should see some code running on the LED tile on the. So what I'm trying to say is it's really easy to set it up. I have a little access point you made myself with just a few lines of code and talking to a device over there in the audience. So the first thing how easy and convenient it is to use micro-python. And yeah, that's basically what I wanted to say. So are there any questions? Thank you very much Christine. You're welcome. If you guys. So the next speaker. Yes. We're waiting for the next speaker. So who's next to speak? Here is the next speaker. There's something for you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. There's some water if you want. Thank you. Thank you. Thank you. Thank you. Hello, Internet. What else? We'll start this time. Power management solutions. Here we have some. We have a microphone. We have to wait. We have to wait. We have to wait. We have to wait. We have to wait. We have to wait. We have to wait.
 So, yeah, what is micro-python all about?  Python, it's a re-implementation of Python 3.  So it's aimed to be efficient to run on a microcontroller and in constrained systems.  So it's not Python, as you know it from the desktop computer.  It's Python as a re-implementation of it.  There are a lot of different development platforms out there already that ship with micro-python  pre-installed.  So you have the official micro-python pieboards and some cameras that run micro-python as  the optical recognition.  OtherFruit has a circuit-python port of micro-python and they are doing a lot of hardware and supporting  the community in quite some big effort.  Then there's BBC Micro-Python, there's a company named PyCom so it's already quite a lot out  there if you want to try it out.  You can also try it out online on our homepage in a simulator.  Micro-python had started about five years ago with a Kickstarter campaign.  Damien George is the creator of it.  He is an Australian physicist who was working at Cambridge at the time.  He had the idea of putting Python on a microcontroller.  So he ran this kick-start and turned out to be quite successful.  So there was a lot of interest in having a high-level scripting language running to control  low-level hardware.  This was about five years ago and since then a lot has happened.  Some of you might know the BBC Micro-Bit for example, which was given in the year 2016  to about a million children in the UK so that they learn teaching, that they learn Python  in school with Micro-Python on the BBC Micro-Bit so they get interaction from hardware and  software and the people think that might be quite some fun.  Then there's been the first O'Reilly book from Niclas Toller, a programming with Micro-Python.  Micro-Python is an open source project which is hosted on GitHub and it's about 7,500  stars so it's quite popular and it's growing.  Also, Micro-Python has been into space.  What Micro-Python aims to be is on the one side you want to have low-power applications.  It wants to be small in size, in terms of code.  It doesn't like to have a lot of storage space to run in and of course the most pressure  time it wants to be fast.  All this combined together, it's kind of more sufficient.  Well, I'm going to speed this up a little bit.  I want to do a little live demo today with the new Python D which is the second generation  of the official Micro-Python PyBot.  I have one here connected to my PC which runs as an access point because I made up my own  little Wi-Fi to make sure that it's going to be working hopefully.  So I have someone that supports me in the audience.  Very good.  And I'm going to log in through a web repel which you can see here.  So I'm going to disconnect it again and connect.  Can you all see that?  It's going to ask me about the password and I'll actually connect it into the device.  The gentleman in front has.  I'm going to run a little code that I have prepared.  First I'm going to read some sensors.  Now you should see a blinking LED maybe.  Not from over.  And some noise.  Some people might hear it and you can see it's reading sensors.  So it's sending it back to my machine.  And we're going to do some more fun stuff.  Let's see.  So now you should see some code running on the LED tile on the.  So what I'm trying to say is it's really easy to set it up.  I have a little access point you made myself with just a few lines of code and talking  to a device over there in the audience.  So the first thing how easy and convenient it is to use micro-python.  And yeah, that's basically what I wanted to say.  So are there any questions?  Thank you very much Christine.  You're welcome.  If you guys.  So the next speaker.  Yes.  We're waiting for the next speaker.  So who's next to speak?  Here is the next speaker.  There's something for you.  Thank you.  Thank you.  Thank you.  Thank you.  Thank you.  Thank you.  Thank you.  There's some water if you want.  Thank you.  Thank you.  Thank you.  Thank you.  Hello, Internet.  What else?  We'll start this time.  Power management solutions.  Here we have some.  We have a microphone.  We have to wait.  We have to wait.  We have to wait.  We have to wait.  We have to wait.  We have to wait.  We have to wait.
MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__0_167.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__168_215.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__216_2315.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__2316_4979.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__4980_5183.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__5184_9023.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__9024_9287.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__9288_10139.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__10140_10199.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__10200_10427.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__10428_11999.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__12000_12635.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__12636_13475.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__13476_13523.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__13524_13643.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__13644_13895.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__13896_22631.png MicroPython___Python_for_Microcontrollers_How_high-level_scripting_languages_make_your_hardware_pro__22632_22748.png