SlideShare uma empresa Scribd logo
1 de 12
Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python
Python for microcontrollers
About me
Works at Carriots.com
Sofware Developer Internet Of Things Platform
Core platform developer
Integration third-party hardware/systems/software
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python
Python for microcontrollers
“Micro Python was successfully funded via a
Kickstarter campaign. The software is available to
the public under the MIT open source license. ”
micropython.org
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python
Python for microcontrollers
“Micro Python is a lean and fast implementation
of the Python 3 programming language that is
optimised to run on a microcontroller.”
micropython.org
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python
Python for microcontrollers
“The Micro Python board is a small electronic
circuit board that runs Micro Python on the bare
metal, and gives you a low-level Python operating
system that can be used to control all kinds of
electronic projects.”
micropython.org
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python
● Full implementation of Python 3 grammar. Cpython 3.4 (no
batteries)
● Implements lexer, parse, compiler, vm and runtime.
● Execute files or REPL.
● Python code is compiled to byte code that run in vm.
● Storing objects in efficient ways.
● Decorator can compiled to native code. 2 time faster than
byte code.
● Memory is managed using a simple and fast mark-sweep
garbage collector.
Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python Board
● Based on the STM32F405 microcontroller.
● The microcontroller is clocked at 168MHz.
● 1MiB flash.
● 192KiB RAM.
● The board measures 33x40 mm.
● USB interface.
● Micro SD slot.
● 2 LEDs, a switch, a real-time clock, an accelerometer, and
30 general purpose I/O pins.
Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python as a "mini Python operating system"
● Checks for a local filesystem on the flash.
● Checks for /boot.py.
● Runs /boot.py to configure USB and other low-level
parameters that can't be changed without a reset.
● The main Python script is run if it exists. Default is
/src/main.py.
● If the main script doesn't exist, or exits, REPL (read-
evaluate-print-loop) mode is entered.
Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Python standard libraries
● cmath – mathematical functions for complex numbers
● gc – control the garbage collector
● math – mathematical functions
● os – basic “operating system” services
● select – wait for events on a set of streams
● struct – pack and unpack primitive data types
● sys – system specific functions
● time – time related functions
additional libs in https://github.com/micropython/micropython-lib
Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Python standard libraries “micro-ified”
● ubinascii – binary/ASCII conversions
● uhashlib – hashing algorithm
● uheapq – heap queue algorithm
● ujson – JSON encoding and decoding
● ure – regular expressions
● usocket – socket module
● uzlib – zlib decompression
Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Libraries specific to the pyboard
● pyb
● Network: CC3K (wifi), WIZNET5K (ethernet)

Mais conteúdo relacionado

Mais procurados

Introduction to raspberry pi
Introduction to raspberry piIntroduction to raspberry pi
Introduction to raspberry pi동호 손
 
arduino
 arduino arduino
arduinojhcid
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoRichard Rixham
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Mrunal Deshkar
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 
register file structure of PIC controller
register file structure of PIC controllerregister file structure of PIC controller
register file structure of PIC controllerNirbhay Singh
 
IIOT – Opportunities & Challenges (How-To Start Your IoT Project).pdf
IIOT – Opportunities & Challenges (How-To Start Your IoT Project).pdfIIOT – Opportunities & Challenges (How-To Start Your IoT Project).pdf
IIOT – Opportunities & Challenges (How-To Start Your IoT Project).pdfDr. Mazlan Abbas
 
Siri voice controlled personal assistant
Siri  voice controlled personal assistantSiri  voice controlled personal assistant
Siri voice controlled personal assistantharoonrashidlone
 
applications of arduino
applications of arduinoapplications of arduino
applications of arduinoshubhamw25
 
IoT Smart keychain finder project
IoT Smart keychain finder project IoT Smart keychain finder project
IoT Smart keychain finder project RShkShrm
 
Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)Dragos Ionita
 

Mais procurados (20)

Introduction to raspberry pi
Introduction to raspberry piIntroduction to raspberry pi
Introduction to raspberry pi
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
arduino
 arduino arduino
arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Edge detector robot
Edge detector robotEdge detector robot
Edge detector robot
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor
 
Arduino
ArduinoArduino
Arduino
 
Aurdino presentation
Aurdino presentationAurdino presentation
Aurdino presentation
 
Line follower robot
Line follower robotLine follower robot
Line follower robot
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
register file structure of PIC controller
register file structure of PIC controllerregister file structure of PIC controller
register file structure of PIC controller
 
IIOT – Opportunities & Challenges (How-To Start Your IoT Project).pdf
IIOT – Opportunities & Challenges (How-To Start Your IoT Project).pdfIIOT – Opportunities & Challenges (How-To Start Your IoT Project).pdf
IIOT – Opportunities & Challenges (How-To Start Your IoT Project).pdf
 
Siri voice controlled personal assistant
Siri  voice controlled personal assistantSiri  voice controlled personal assistant
Siri voice controlled personal assistant
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
 
applications of arduino
applications of arduinoapplications of arduino
applications of arduino
 
IoT Smart keychain finder project
IoT Smart keychain finder project IoT Smart keychain finder project
IoT Smart keychain finder project
 
Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)
 
Arduino uno
Arduino unoArduino uno
Arduino uno
 
Bluetooth controlled robot
Bluetooth controlled robotBluetooth controlled robot
Bluetooth controlled robot
 

Destaque

Getting Started with MicroPython and LoPy
Getting Started with MicroPython and LoPyGetting Started with MicroPython and LoPy
Getting Started with MicroPython and LoPyChristian Fässler
 
Internet Of Things - BetabeersZGZ 26-09-14
Internet Of Things - BetabeersZGZ 26-09-14Internet Of Things - BetabeersZGZ 26-09-14
Internet Of Things - BetabeersZGZ 26-09-14Samuel de Ancos
 
Advanced Python : Static and Class Methods
Advanced Python : Static and Class Methods Advanced Python : Static and Class Methods
Advanced Python : Static and Class Methods Bhanwar Singh Meena
 
Advance OOP concepts in Python
Advance OOP concepts in PythonAdvance OOP concepts in Python
Advance OOP concepts in PythonSujith Kumar
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonSujith Kumar
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners Sujith Kumar
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Paige Bailey
 
Seminar report On Python
Seminar report On PythonSeminar report On Python
Seminar report On PythonShivam Gupta
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesMatt Harrison
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to PythonNowell Strite
 

Destaque (10)

Getting Started with MicroPython and LoPy
Getting Started with MicroPython and LoPyGetting Started with MicroPython and LoPy
Getting Started with MicroPython and LoPy
 
Internet Of Things - BetabeersZGZ 26-09-14
Internet Of Things - BetabeersZGZ 26-09-14Internet Of Things - BetabeersZGZ 26-09-14
Internet Of Things - BetabeersZGZ 26-09-14
 
Advanced Python : Static and Class Methods
Advanced Python : Static and Class Methods Advanced Python : Static and Class Methods
Advanced Python : Static and Class Methods
 
Advance OOP concepts in Python
Advance OOP concepts in PythonAdvance OOP concepts in Python
Advance OOP concepts in Python
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
 
Seminar report On Python
Seminar report On PythonSeminar report On Python
Seminar report On Python
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 Minutes
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 

Semelhante a Micro-python

MicroPython&electronics prezentācija
MicroPython&electronics prezentācija MicroPython&electronics prezentācija
MicroPython&electronics prezentācija CRImier
 
Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1Marcus Tarquinio
 
Damien George - Micro Python - CIUUK14
Damien George - Micro Python - CIUUK14Damien George - Micro Python - CIUUK14
Damien George - Micro Python - CIUUK14Daniel Lewis
 
Python in the real world : from everyday applications to advanced robotics
Python in the real world : from everyday applications to advanced roboticsPython in the real world : from everyday applications to advanced robotics
Python in the real world : from everyday applications to advanced roboticsJivitesh Dhaliwal
 
An_Introduction_to_Microcontrollers.pptx
An_Introduction_to_Microcontrollers.pptxAn_Introduction_to_Microcontrollers.pptx
An_Introduction_to_Microcontrollers.pptxStefan Oprea
 
Boards for the IoT-Prototyping
Boards for the IoT-PrototypingBoards for the IoT-Prototyping
Boards for the IoT-PrototypingLars Gregori
 
Design and implementation of real time security guard robot using GSM/CDMA ne...
Design and implementation of real time security guard robot using GSM/CDMA ne...Design and implementation of real time security guard robot using GSM/CDMA ne...
Design and implementation of real time security guard robot using GSM/CDMA ne...Claude Ndayisenga
 
PyCon_India_2017_MicroPython_Ayan
PyCon_India_2017_MicroPython_AyanPyCon_India_2017_MicroPython_Ayan
PyCon_India_2017_MicroPython_AyanAyan Pahwa
 
[German] Boards für das IoT-Prototyping
[German] Boards für das IoT-Prototyping[German] Boards für das IoT-Prototyping
[German] Boards für das IoT-PrototypingLars Gregori
 
Microprocessors presentation
Microprocessors  presentationMicroprocessors  presentation
Microprocessors presentationWakilKhan5
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsSamsung Open Source Group
 
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programmingmicrobit Microbit programming Microbit programming
microbit Microbit programming Microbit programmingssuser5feb2c1
 
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdfAdvanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdfWiseNaeem
 
microprocessor
microprocessormicroprocessor
microprocessorillpa
 
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID CreationNagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID CreationNagios
 
Basics of Embedded systems presentation - lynxbee.com
Basics of Embedded systems presentation - lynxbee.comBasics of Embedded systems presentation - lynxbee.com
Basics of Embedded systems presentation - lynxbee.comGreen Ecosystem
 
Sistem mikroprosessor
Sistem mikroprosessorSistem mikroprosessor
Sistem mikroprosessorfahmihafid
 
MergeResult_2023_04_02_05_26_56.pptx
MergeResult_2023_04_02_05_26_56.pptxMergeResult_2023_04_02_05_26_56.pptx
MergeResult_2023_04_02_05_26_56.pptxbhaveshagrawal35
 
What is a microcontroller
What is a microcontrollerWhat is a microcontroller
What is a microcontrollerparassini
 

Semelhante a Micro-python (20)

MicroPython&electronics prezentācija
MicroPython&electronics prezentācija MicroPython&electronics prezentācija
MicroPython&electronics prezentācija
 
Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1
 
Damien George - Micro Python - CIUUK14
Damien George - Micro Python - CIUUK14Damien George - Micro Python - CIUUK14
Damien George - Micro Python - CIUUK14
 
Python in the real world : from everyday applications to advanced robotics
Python in the real world : from everyday applications to advanced roboticsPython in the real world : from everyday applications to advanced robotics
Python in the real world : from everyday applications to advanced robotics
 
An_Introduction_to_Microcontrollers.pptx
An_Introduction_to_Microcontrollers.pptxAn_Introduction_to_Microcontrollers.pptx
An_Introduction_to_Microcontrollers.pptx
 
Boards for the IoT-Prototyping
Boards for the IoT-PrototypingBoards for the IoT-Prototyping
Boards for the IoT-Prototyping
 
Design and implementation of real time security guard robot using GSM/CDMA ne...
Design and implementation of real time security guard robot using GSM/CDMA ne...Design and implementation of real time security guard robot using GSM/CDMA ne...
Design and implementation of real time security guard robot using GSM/CDMA ne...
 
PyCon_India_2017_MicroPython_Ayan
PyCon_India_2017_MicroPython_AyanPyCon_India_2017_MicroPython_Ayan
PyCon_India_2017_MicroPython_Ayan
 
[German] Boards für das IoT-Prototyping
[German] Boards für das IoT-Prototyping[German] Boards für das IoT-Prototyping
[German] Boards für das IoT-Prototyping
 
Microprocessors presentation
Microprocessors  presentationMicroprocessors  presentation
Microprocessors presentation
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
 
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programmingmicrobit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
 
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdfAdvanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
 
microprocessor
microprocessormicroprocessor
microprocessor
 
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID CreationNagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
 
Basics of Embedded systems presentation - lynxbee.com
Basics of Embedded systems presentation - lynxbee.comBasics of Embedded systems presentation - lynxbee.com
Basics of Embedded systems presentation - lynxbee.com
 
Sistem mikroprosessor
Sistem mikroprosessorSistem mikroprosessor
Sistem mikroprosessor
 
Unit-1.pptx
Unit-1.pptxUnit-1.pptx
Unit-1.pptx
 
MergeResult_2023_04_02_05_26_56.pptx
MergeResult_2023_04_02_05_26_56.pptxMergeResult_2023_04_02_05_26_56.pptx
MergeResult_2023_04_02_05_26_56.pptx
 
What is a microcontroller
What is a microcontrollerWhat is a microcontroller
What is a microcontroller
 

Último

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESNarmatha D
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Steel Structures - Building technology.pptx
Steel Structures - Building technology.pptxSteel Structures - Building technology.pptx
Steel Structures - Building technology.pptxNikhil Raut
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 

Último (20)

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIES
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Steel Structures - Building technology.pptx
Steel Structures - Building technology.pptxSteel Structures - Building technology.pptx
Steel Structures - Building technology.pptx
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 

Micro-python

  • 1. Micro Python Python for microcontrollers Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
  • 2. Micro Python Python for microcontrollers About me Works at Carriots.com Sofware Developer Internet Of Things Platform Core platform developer Integration third-party hardware/systems/software Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
  • 3. Micro Python Python for microcontrollers “Micro Python was successfully funded via a Kickstarter campaign. The software is available to the public under the MIT open source license. ” micropython.org Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
  • 4. Micro Python Python for microcontrollers “Micro Python is a lean and fast implementation of the Python 3 programming language that is optimised to run on a microcontroller.” micropython.org Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
  • 5. Micro Python Python for microcontrollers “The Micro Python board is a small electronic circuit board that runs Micro Python on the bare metal, and gives you a low-level Python operating system that can be used to control all kinds of electronic projects.” micropython.org Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
  • 6. Micro Python Python for microcontrollers Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
  • 7. Micro Python Python for microcontrollers Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om Micro Python ● Full implementation of Python 3 grammar. Cpython 3.4 (no batteries) ● Implements lexer, parse, compiler, vm and runtime. ● Execute files or REPL. ● Python code is compiled to byte code that run in vm. ● Storing objects in efficient ways. ● Decorator can compiled to native code. 2 time faster than byte code. ● Memory is managed using a simple and fast mark-sweep garbage collector.
  • 8. Micro Python Python for microcontrollers Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om Micro Python Board ● Based on the STM32F405 microcontroller. ● The microcontroller is clocked at 168MHz. ● 1MiB flash. ● 192KiB RAM. ● The board measures 33x40 mm. ● USB interface. ● Micro SD slot. ● 2 LEDs, a switch, a real-time clock, an accelerometer, and 30 general purpose I/O pins.
  • 9. Micro Python Python for microcontrollers Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om Micro Python as a "mini Python operating system" ● Checks for a local filesystem on the flash. ● Checks for /boot.py. ● Runs /boot.py to configure USB and other low-level parameters that can't be changed without a reset. ● The main Python script is run if it exists. Default is /src/main.py. ● If the main script doesn't exist, or exits, REPL (read- evaluate-print-loop) mode is entered.
  • 10. Micro Python Python for microcontrollers Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om Python standard libraries ● cmath – mathematical functions for complex numbers ● gc – control the garbage collector ● math – mathematical functions ● os – basic “operating system” services ● select – wait for events on a set of streams ● struct – pack and unpack primitive data types ● sys – system specific functions ● time – time related functions additional libs in https://github.com/micropython/micropython-lib
  • 11. Micro Python Python for microcontrollers Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om Python standard libraries “micro-ified” ● ubinascii – binary/ASCII conversions ● uhashlib – hashing algorithm ● uheapq – heap queue algorithm ● ujson – JSON encoding and decoding ● ure – regular expressions ● usocket – socket module ● uzlib – zlib decompression
  • 12. Micro Python Python for microcontrollers Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om Libraries specific to the pyboard ● pyb ● Network: CC3K (wifi), WIZNET5K (ethernet)