SlideShare ist ein Scribd-Unternehmen logo
1 von 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)

Weitere ähnliche Inhalte

Was ist angesagt?

Interfacing the Raspberry Pi to the World
Interfacing the Raspberry Pi to the WorldInterfacing the Raspberry Pi to the World
Interfacing the Raspberry Pi to the WorldOmer Kilic
 
Python ppt.pdf
Python ppt.pdfPython ppt.pdf
Python ppt.pdfkalai75
 
Raspberry Pi Presentation
Raspberry Pi PresentationRaspberry Pi Presentation
Raspberry Pi PresentationGeekizer
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythoneShikshak
 
Introduction to raspberry pi
Introduction to raspberry piIntroduction to raspberry pi
Introduction to raspberry pipraveen_23
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry piHusainBhaldar21
 
Python games
Python gamesPython games
Python gamesmolw
 
Internet of things using Raspberry Pi
Internet of things using Raspberry PiInternet of things using Raspberry Pi
Internet of things using Raspberry PiYash Gajera
 
Introducing MQTT
Introducing MQTTIntroducing MQTT
Introducing MQTTAndy Piper
 
Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Mandeesh Singh
 

Was ist angesagt? (20)

Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Autobahn primer
Autobahn primerAutobahn primer
Autobahn primer
 
Interfacing the Raspberry Pi to the World
Interfacing the Raspberry Pi to the WorldInterfacing the Raspberry Pi to the World
Interfacing the Raspberry Pi to the World
 
Python ppt.pdf
Python ppt.pdfPython ppt.pdf
Python ppt.pdf
 
Raspberry Pi Presentation
Raspberry Pi PresentationRaspberry Pi Presentation
Raspberry Pi Presentation
 
Python programming
Python  programmingPython  programming
Python programming
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
IoT with Python
IoT with PythonIoT with Python
IoT with Python
 
Introduction to raspberry pi
Introduction to raspberry piIntroduction to raspberry pi
Introduction to raspberry pi
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
 
Rasp berry Pi
Rasp berry PiRasp berry Pi
Rasp berry Pi
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python
PythonPython
Python
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Python games
Python gamesPython games
Python games
 
Internet of things using Raspberry Pi
Internet of things using Raspberry PiInternet of things using Raspberry Pi
Internet of things using Raspberry Pi
 
Introducing MQTT
Introducing MQTTIntroducing MQTT
Introducing MQTT
 
IoT: An introduction
IoT: An introductionIoT: An introduction
IoT: An introduction
 
Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Raspberry Pi (Introduction)
Raspberry Pi (Introduction)
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 
Micropython for the iot
Micropython for the iotMicropython for the iot
Micropython for the iotJacques Supcik
 
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
 

Ähnlich wie 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
 
Micropython for the iot
Micropython for the iotMicropython for the iot
Micropython for the iot
 
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
 

Kürzlich hochgeladen

Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 

Kürzlich hochgeladen (20)

Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 

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)