Hi and welcome back.
In this lecture, I'll talk about Michael Python and I talk about it's written to exist, how it relates
to Python and about some of its most important characteristics.
Around Meet the 2014 Demián George published a new programming language for Marketplace called Macra
Python.
This publication was a successful completion of an ambitious Kickstarter project that began in 2013
at the Time magazine.
Troller programming was dominated by the seed language.
If you are familiar with their, then you know what she looks like.
On a microcontroller like the sea is not very difficult to learn, however, things do get more complicated
as programs get bigger.
As microcontrollers started becoming more and more powerful, more people started being interested in
them and to be programming them.
Many of them were first time programmers and this included people in all age brackets.
So Damien wanted to create a language that would work on a microcontroller that would be much easier
to learn and use.
Then C he didn't want to reinvent the wheel, so he chose Python as his prototype.
His challenge then was to create a language that can mimic Python, but that can also run on the bare
metal of a multicultural, not without an operating system.
And that's how Michael Python came about.
And here's a description of the language from the Micro Python website.
And the emphasis in both characters is mine.
So Micro Python is a lean and efficient implementation of the Python three programming language that
includes a small subset of the Python standard library and is optimized to run on microcontrollers and
in constrained environments.
Now, because Michael Python contains the word python, it is easy to become confused and think that
Python is simply a smaller version of Python.
It is the same confusion that I constantly see between Java and JavaScript, while Python and Market
Python have a similar name.
They are totally different languages with a different set of goals and implementation.
I talk more about the differences between Python and macro python in a later lecture, but for now I
just want to make sure that you are not confused by the similarity in the name.
What Margaret Python has taken from Python is the language architecture, its programming philosophy
for code readability and a huge pool of programmers that already know how to use Python.
Python is this can quickly become micro python estás and write programs for microcontrollers.
According to the papal popularity of programming, language indexed, Python is the most popular programming
language in the world with a 30 percent share.
This index is calculated based on the amount of searching that is done on Google for programming, language,
tutorials and resources.
And as a comparison, it's interesting to see that C C++ that is used by the boards ranks around fifth
place in this index.
This popularity translates to a python universe that is filled with all the documentation, libraries
and community support you ever need.
Micro python is as easy as Python to learn, and it follows Python tradition for excellent development
tools and documentation.
In this course you see me constantly browsing through the Python code.
The documentation as well as many of the excellent libraries will be using in terms of tools.
You have many choices in this course, in particular will be using thony, but you can also choose tools
such as you, Pycroft, and the new ED.
What I really like about Tony is that it's a full python, Ed, on its own merit with excellent debugging
tools, but also that fully supports market python on the E.S.P three two, as well as other target
boards like the Recipe Pickle and the BBC Microfit.
Another big advantage of the macro python language is that once you learn it, you can use your skills
across multiple hardware targets.
At the time I'm recording this lecture, Micropayment Python has support for the original mainboard
version one and disappears, as well as third party boards such as the SDM 32 NUCLEO and Discovery Boards,
The Peko, the Raspberry Pi, Pekoe, the White Pine, the EPA two, six, six and three to the tiny
Pikul and the BBC.
Markovits, I mentioned earlier and this was just a partial list.
Now let's take a quick tour of Michael Python's most important features, first and most important for
anyone new to this language is that Michael Python aims to implement the Python three point four with
a little bit of three point five standard for language and syntax.
This simply means that anyone who already programs in Python three will be able to start programming
in Python immediately.
Python, three reserved keywords operators functions in the infamous white space incantation is faithfully
implemented in micro python.
Second, because micro python targets embedded computers and microcontrollers is not possible to implement
the Python standard library with all of its modules and methods.
There's simply not enough storage on ITHAKA devices for that.
Therefore, Micro Python implements a selected subset of C Python standard library, and even that is
implemented with emphasis in efficiency.
Micro python versions of Python libraries have a name with the you or lowercase you the letter prefix.
So that allows you to distinguish which is which.
Whenever you see a micro python library with a U letter prefix, know that it's a more efficient version
or optimized version of the original C Python Library implemented for micro Python devices for Micro
Python has an interactive interpretive mode, also known as Reppel Rebel stands for Reidsville Print
Loop.
Think of it as a command line for Python.
It can use this command line to issue Python instructions or even code blocks.
The report will evaluate the Python code immediately, and the macro Python report is fully featured
with the intent of the completion ability to interrupt the Iranian program with controversy to invoke
a soft reset and so on.
There's also a paiste mood, and you can also use the underscore variable, the stores, the output
of the previous computation in this course of using the ruble extensively to demonstrate in test code.
Fourth, outside of the micropayment standard library, there are countless libraries contributed by
users and published online on repositories like GitHub and Piper, which is the Python package index,
similar to see Python Micro Python has a simple mechanism for including external code programs.
In this case, I'll show you how to find and use the external libraries that make it easy to integrate
hardware components like screens and sensors to your mark of Python projects.
Fifth, Margaret Python has the ability to access a small filesystem on the target market with a device,
this filesystem makes it possible to store your micro python programs, supporting library files and
arbitrary files, such as text files for storing sensor data or credentials for networks and Iot services
or even bitmap image files.
You want to display them on and or ality, for example, by showing you a similar example later on in
this course.
In this course, I have prepared several examples where I demonstrate how to use the filesystem or the
ESB 30 to.
And finally, the six point micro python has a single command line python tool that allows you to run
a script or access the file system on a target device.
This tool is called PIEBALD.
Don't apply in this course.
We won't be using this tool because Sony idea has built in support for micro python on a variety of
target devices, including the ESB three two.
However, I wanted to mention piebald that we are here because it is something useful for you to be
aware of.
Let's talk about market python on a variety of hardware targets now, as you probably already know,
micro python works on many different microcontrollers, and diversity of the hardware means that not
all micro python code will work across those devices without modifications.
In general, there are two points to remember in relation to Shery micro python code across different
targets.
One, most of the code that uses micro python standard library functions and the core of a language
will work without any modifications.
Language, syntax, reserve key words, control structures and functions that come from these standard
libraries such as math for mathematics.
YIVO is for basic operating system services and use time for time and date related functions will work
across all micro python hardware targets.
Nothing to worry about to throw.
On the other hand, any functionality that is uniquely implemented on a market controller requires a
unique implementation in micro python.
For example, the way the digital pen functionality is implemented on a device like the E.S.P 32 is
different to the implementation on a Raspberry Pi.
There are things that Raspberry Pi pickle pens can do, for example, that E.S.P 32 can do.
And it's a similar case for how functions relating to network interfaces is Quixey and Spart interfaces,
analog digital converters and so on are implemented across boards.
These differences are reflected in the micro python implementation for each board.
And for this reason, in addition to the standard, the Library Micro Python has libraries specifically
implemented for each supported board.
You should take a bit of time to study your target device special libraries so that you know what is
available and what isn't.
And therefore you can go about taking advantage of the specific capabilities of the device that you
have chosen.
And one more thing, when I'm talking about this, not old device capabilities can be accessed through
micro python, for example, in the E.S.P 32 Micron Python firmware.
There is no support for Bluetooth.
There is no Bluetooth module, even though, as you know, the ability to has Bluetooth capability.
But there is support for Wi-Fi.
And it's just one example of a capability that you won't be able to use using micro python.
OK, now let's wrap up this lecture by going back to Michael Python's most important attribute, Michael
Python, like Python, is designed to be readable.
It almost reads like natural language.
And here you can see an example of a segment of a code that I extracted from one of the lectures that
are coming up later on in this cause.
Even if you've never seen my cat Python written before, perhaps you never even programmed before.
You may be able you should be able actually to understand kind of what this code segment is doing.
You can make inferences about what this code segment is supposed to do.
You do need to have a basic understanding of electronics.
So, for example, keywords like pin that out and pin dot pull up may not make much sense.
However, the language barrier to entry for micro python is minimal.
Essentially, it's much lower than the barrier to entry for a language like C or C++.
And this is the number one reason why Python became so popular and why Michael Python has been gaining
massive support in popularity since the Kickstarter campaign in 2014.
All right.
It's about it.
With this lecture and in the next few lectures of this first section of the course, I've covered a
few housekeeping topics, including the software and hardware requirements and how to make the most
out of this course to please do take the time to watch these lectures before continuing to Section two,
which focuses a python.