SlideShare a Scribd company logo
Micro Python 䛷 
⤌䜏㎸䜏 Python 
@hktechno 
Hirotaka Kawata
@hktechno 
ᕝ⏣ ⿱㈗ (䛛䜟䛯 䜂䜝䛯䛛) 
● PyCon JP 2013-2014 Staff (Program Team) 
● ⟃Ἴ኱Ꮫ 䝅䝇䝔䝮᝟ሗᕤᏛ◊✲⛉ 
䝁䞁䝢䝳䞊䝍䝃䜲䜶䞁䝇ᑓᨷ 
○ ಟኈ 1ᖺ 
● Open Design Computer Project 
○ 2011 ᮍ㋃IT䛺䜣䛸䛛 䝇䞊䝟䞊䜽䝸䜶䜲䝍䞊 
○ http://open-arch.org/
Micro Python 
● Python for microcontrollers 
○ 䝬䜲䝁䞁䛷౑䛘䜛 Python 
○ KICKSTARTER 䛷 97,803 GBP (⣙1500୓෇) ⋓ᚓ 
● The pyboard 
○ Micro Python ⏝䛾䝬䜲䝁䞁ᇶᯈ 
http://micropython.org/ 
㠃ⓑ䛭䛖
Micro Python 
● Python 3 ஫᥮䛾 Python ฎ⌮⣔ 
○ 䝬䜲䝁䞁ྥ䛡䛻෌ᐇ⿦ (CPython 䛷䛿䛺䛔) 
○ 䝷䜲䝤䝷䝸䜒ᇶᮏⓗ䛺䜒䛾䛿౑䛘䜛 
● 䝬䜲䝁䞁ୖ䛷 Python 䛜ື䛟 
○ Arduino 䛾䜘䛖䛺ᡭ㍍䛥 
○ 䛧䛛䜒 Python 䛷᭩䛡䜛 
○ Python ෆ䛷䜲䞁䝷䜲䞁䜰䝉䞁䝤䝷䛜౑䛘䛯䜚... (!!) 
● REPL 䜒౑䛘䜛 
○ 䝬䜲䝁䞁ୖ䛷䜲䞁䝍䝷䜽䝔䜱䝤䝅䜵䝹
The pyboard 
● Micro Python board 
○ STM32F4 (Cortex-M4) 
○ microSD slot 
○ microUSB 
○ Accelerometer 
○ 4 LED 
○ Switch… 
● KICKSTARTER 
○ $20 (early-bird price) 
○ $24
vs Raspberry Pi 
● GPIO 
○ Raspberry Pi 䛿䛱䜗䛳䛸ᑡ䛺䜑 
○ (Type B+ 䛷ᑡ䛧ቑ䛘䜎䛧䛯) 
● Price 
○ 3940෇... 
● 㛤Ⓨ䛜㠃ಽ䛟䛥䛔 
○ Raspberry Pi 䛾 Linux 䛷㛤Ⓨ䛩䜛 or SSH 
○ 䛭䜒䛭䜒䝬䜲䝁䞁䛷䛿䛺䛔...
vs mruby 
ᛮ᝿䛾㐪䛔 
● mruby 
○ ⤌䜏㎸䜏ᶵჾ䛷 C 䛛䜙 Ruby 䜢ᢅ䛖 
○ 䝋䝣䝖䜴䜵䜰䛻⤌䜏㎸䜏䜒䛷䛝䜛 (Lua 䛾䜘䛖䛺) 
○ ୺䛻䚸䝞䜲䝖䝁䞁䝟䜲䝹䛧䛯䝞䜲䝘䝸䜢ᢞධ 
● Micro Python 
○ Python 䛷ᇶᮏⓗ䛻᏶⤖䛩䜛 
○ 䝬䜲䝁䞁䚸䝩䝡䞊⏝㏵ྥ䛡 
○ Python 䝇䜽䝸䝥䝖䜢᭩䛝㎸䜐 
○ REPL 䛷䜲䞁䝍䝷䜽䝔䜱䝤䛻䜒᧯సྍ⬟
䛧䛛䛧... 
● pyboard 䛿⌧ᅾධᡭ୙ྍ⬟ 
○ KICKSTARTER 䛾㉎ධศ䛿Ⓨ㏦῭䜏 
○ ḟ䛾䝻䝑䝖䜢⏕⏘䛩䜛䜙䛧䛔䠛 
○ 䛹䛱䜙䛻䛧䛶䜒䛩䛠䛻䛿ධᡭ୙ྍ⬟... 
● ண䜑Ⓩ㘓䛧䛶䛒䛳䛯ே䛾ඛ⾜㈍኎䜒... 
○ ᡭඖ䛻౑䛘䜛䜹䞊䝗䛜䛺䛟䛶Ỵ῭ኻᩋ 
○ Out of stock! orz
ㅉ䜑䜛䛾䛿䜎䛰᪩䛔䟿
ᡭ㍍䛻 Micro Python 
● STM32F4 Discovery 
○ ST Micro ⣧ṇ䛾 STM32F407 ホ౯䝪䞊䝗 
○ ⛅᭶㟁Ꮚ㏻ၟ䛷 1,750 ෇ 
● ᶵ⬟ 
○ 192KB RAM 
○ 1MB Flash 
○ LED x 4 
○ Accelerometer 
○ D-class AMP 
○ Microphone 
○ USB (mini + micro)
STM32F4 Disvoery ‽ഛ 
● Micro Python 䝉䝑䝖䜰䝑䝥᪉ἲ 
○ https://github. 
com/micropython/micropython/wiki/Board- 
STM32F407-Discovery 
$ cd stmhal 
$ make BOARD=STM32F4DISC 
● 䝣䜯䞊䝮䜴䜵䜰䜢᭩䛝᥮䛘䜛ᚲせ䛜䛒䜛 
○ BOOT0 - Vdd 䜢䝅䝵䞊䝖 
■ ⿬ഃ䛾䝆䝱䞁䝟䜢౑䛖䛸䜘䛔 (JP2, JP3) 
○ DFU (dfu-util) 䛷 build/flash.dfu 䜢᭩䛝㎸䜏 
■ microUSB 䛾᪉䜢౑䛖䚹䛯䛰䛧㟁※౪⤥䛥䜜䛺䛔䛾䛷୧᪉่䛩䚹
᥋⥆䞉᭩䛝㎸䜏 
● USB 䝇䝖䝺䞊䝆䛸䛧䛶ㄆ㆑䛩䜛 
○ boot.py: ㉳ື᫬䛻ᐇ⾜䛥䜜䜛 
○ main.py: 䝯䜲䞁䝥䝻䜾䝷䝮 
○ 䝋䞊䝇 (main.py) 䜢䝁䝢䞊䛩䜛䛰䛡䛷Ⰻ䛔 
○ ⮬ศ䛷స䛳䛯䝰䝆䝳䞊䝹䜒᭩䛝㎸䜏䞉฼⏝䛷䛝䜛 
● REPL 䜢❧䛱ୖ䛢䜛 
○ USB ௬᝿䝅䝸䜰䝹䝫䞊䝖䜒స䜙䜜䜛 
■ Linux 䛾ሙྜ /dev/ttyACM0 
○ ᥋⥆䛩䜛䛸 Micro Python REPL 䝅䜵䝹䛜౑䛘䜛
pyb Module 
● pyboard 䜢᧯స䛩䜛䝰䝆䝳䞊䝹 
○ pyb.Pin 
○ pyb.LED 
○ pyb.Switch 
○ pyb.SPI 
○ pyb.I2C 
○ pyb.UART... 
○ http://micropython.org/doc/module/pyb/ 
● pyboard ྥ䛡䛰䛜... 
○ Discovery 䝪䞊䝗䛷䜒୍㒊䛿฼⏝ྍ⬟
Micro Python REPL 
● Python 䛾 REPL 䛸䜋䜌ྠ䛨 
○ 䜲䞁䝍䝷䜽䝔䜱䝤䛻䝬䜲䝁䞁䜢᧯స䛷䛝䜛 
○ 䝕䝞䝑䜾䛻౽฼ 
○ 䝰䝆䝳䞊䝹䜢᭩䛝㎸䜣䛷䛚䛡䜀䚸䛭䜜䜒౑䛘䜛 
● Ctrl-D 䛷 soft-reset 
○ main.py 䜔䝰䝆䝳䞊䝹䜢᭩䛝᥮䛘䛯᫬䛻౑䛖 
● Ctrl-C 䛷 interrupt 
○ main.py 䛾ᐇ⾜䜢Ṇ䜑䜛
LED ON / OFF 
● 䛸䜚䛒䛘䛪 L 䝏䜹 
led = pyb.LED(1) 
while True: 
led.off() 
pyb.delay(500) 
led.on() 
pyb.delay(500) 
䛣䜜䛷䜒䜘䛔 
led = pyb.LED(1) 
while True: 
led.toggle() 
pyb.delay(500)
Switch 
● Switch 䛷 Callback 䛜౑䛘䜛 
def toggle(): 
pyb.LED(1).toggle() 
pyb.delay(10) 
sw = pyb.Switch() 
sw.callback(toggle)
GPIO 
● pyb.Pin 䜢౑䛖 
pin = pyb.Pin(pyb.Pin.board.PD2, 
pyb.Pin.OUT_PP) 
pin.high() 
pin.low() 
pin_value = pin.value() 
pin.value(False) # => pin.low()
STM32F4DISC STAccel 
● 䠎✀㢮䛾ຍ㏿ᗘ䝉䞁䝃䞊 
○ 䝪䞊䝗䛾䝻䝑䝖䛻䜘䛳䛶㐪䛖 
○ LIS302DL (ྂ䛔) 
○ LIS3DSH (᪂䛧䛔, 㧗ᶵ⬟) 
● staccel.py : STAccel # pyb.Accel 䛿 pyboard ᑓ⏝ 
○ ᡭ㍍䛻ຍ㏿ᗘ䝉䞁䝃䜢ᢅ䛘䜛䝰䝆䝳䞊䝹 
○ stmhal/boards/STM32F4DISC/staccel.py 
○ LIS3DSH ᑐᛂ䝟䝑䝏䜢ᢞ䛢䛶 merge 䛥䜜䛯 
○ https://github.com/micropython/micropython/pull/852
LCD 
ᕷ㈍䛾 LCD 䜢౑䛖 # pyb.LCD 䛿䚸pyboard ᑓ⏝ 
● SC1602 䝅䝸䞊䝈 (ᐃ␒䛾䜰䝺) 
○ ⛅᭶㟁Ꮚ㏻ၟ䛷኎䛳䛶䜎䛩 
○ 䝞䝑䜽䝷䜲䝖䛺䛧䛷䛒䜜䜀 500 ෇䛛䜙 
● Python 䛷 LCD 䝗䝷䜲䝞䜢᭩䛔䛶䜏䜎䛧䛯 
○ https://github.com/techno/micropython_modules 
○ sc1602.py
䛔䜝䛔䜝 DEMO
Performance 
● (ᙜ䛯䜚๓䛰䛡䛹) ⤖ᵓ㐜䛔 
○ Teensy 3.1 (96MHz ARM) 
○ C++ (Arduino like) 䛸䛟䜙䜉䛶䚸⣙ 100 ಸ㐜䛔 
○ https://github. 
com/micropython/micropython/wiki/Performance 
● Arduino 䛷༑ศ䛺⏝㏵䛺䜙ၥ㢟䛻䛺䜙䛺䛔 
○ Arduino Pro Mini (C++) 䛛䜙ẚ䜉䛶4ಸ䛠䜙䛔 
○ 䛫䛳䛛䛟㏿䛔䜽䝻䝑䜽ᩘ䛿↓㥏䛻䛺䜛䛜...
Inline Assembly 
䜲䞁䝷䜲䞁䜰䝉䞁䝤䝷䛾౛ 
@micropython.asm_thumb 
def asm_add(r0, r1): 
add(r0, r0, r1)
Development Sprint 
● 14᪥ Development Sprint 䜔䜚䜎䛩 
○ http://pyconjp.connpass.com/event/8105/ 
● Micro Python Sprint 
○ ゐ䛳䛯䛣䛸䛺䛔ே䛷䜒 OK 
○ STM32F4 Discovery 䝪䞊䝗䜢ᣢ䛳䛶䛟䜛䛸 Better 
● 䜔䜚䛯䛔䛣䛸䛸䛛 
○ 䝪䞊䝗ᦚ㍕䛾D⣭䜰䞁䝥䞉䝬䜲䜽䛾䝗䝷䜲䝞 
○ ௚䛾䝪䞊䝗䜈⛣᳜
௚䛾䝬䜲䝁䞁䜈䛾⛣᳜ 
● GR-SAKURA 䜈⛣᳜䜢ヨ䜏䛯 
○ Renesas RX63N 
● 㐍ᤖ 
○ 䜲䞁䝍䝥䝸䝍䛿ື䛔䛯 
○ print 䛿䛷䛝䜛 
○ 䜎䛰: pyb 䝰䝆䝳䞊䝹 
○ 䜎䛰: REPL 
⤖ㄽ: 䜎䛰STM32௨እ䛻⛣᳜䛩䜛䛾䛿኱ኚ䛭䛖 
⯆࿡䛜䛒䛳䛯䜙 Sprint or Office hour 䛷...
䜎䛸䜑 
● Micro Python 䛺䛛䛺䛛䜘䛥䛭䛖 
○ 䛯䛰䛧䚸䜎䛰䜎䛰ᨵၿ䛾వᆅ䛜䛒䜚䛭䛖 
○ ௚䛾䝪䞊䝗䜈䛾⛣᳜䛻ᮇᚅ 
● Raspberry Pi ౑䛳䛯䜋䛖䛜Ⰻ䛥䛭䛖䛺⏝㏵ 
○ 䝛䝑䝖䝽䞊䜽 
○ Wi-Fi, Bluetooth 
○ USB… 
䝪䞊䝗䛰䛡䛷᏶⤖䛩䜛䛺䜙 Micro Python䟿
Micro Python で組み込み Python

More Related Content

What's hot

Introduction to IPython & Notebook
Introduction to IPython & NotebookIntroduction to IPython & Notebook
Introduction to IPython & Notebook
Areski Belaid
 
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
Claire Rioualen
 
機器學習應用於蔬果辨識
機器學習應用於蔬果辨識機器學習應用於蔬果辨識
機器學習應用於蔬果辨識
Kobe Yu
 
DIY GPS Logger 20130413 #mbed_fest_w
DIY GPS Logger 20130413 #mbed_fest_wDIY GPS Logger 20130413 #mbed_fest_w
DIY GPS Logger 20130413 #mbed_fest_wToshihisa Tanaka
 
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
Linaro
 
Tools for FPGA Development
Tools for FPGA DevelopmentTools for FPGA Development
Tools for FPGA Development
Brahim HAMADICHAREF
 
D1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FFD1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FFAnthony Jose
 
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etcComparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Yukio Okuda
 
The str/bytes nightmare before python2 EOL
The str/bytes nightmare before python2 EOLThe str/bytes nightmare before python2 EOL
The str/bytes nightmare before python2 EOL
Kir Chou
 
自律移動ロボット向けハード・ソフト協調のためのコンポーネント設計支援ツール
自律移動ロボット向けハード・ソフト協調のためのコンポーネント設計支援ツール自律移動ロボット向けハード・ソフト協調のためのコンポーネント設計支援ツール
自律移動ロボット向けハード・ソフト協調のためのコンポーネント設計支援ツール
Kazushi Yamashina
 
Free Mobile - when Android is not enough
Free Mobile - when Android is not enoughFree Mobile - when Android is not enough
Free Mobile - when Android is not enough
Sebastian Krzyszkowiak
 
Republic of IoT - Hackathon Hardware Kits Hands-on Labs
Republic of IoT - Hackathon Hardware Kits Hands-on LabsRepublic of IoT - Hackathon Hardware Kits Hands-on Labs
Republic of IoT - Hackathon Hardware Kits Hands-on Labs
Alwin Arrasyid
 
uRock @ Jserv Course Final
uRock @ Jserv Course Final uRock @ Jserv Course Final
uRock @ Jserv Course Final
宗凡 楊
 
Raspberry Pi and Amateur Radio
Raspberry Pi and Amateur RadioRaspberry Pi and Amateur Radio
Raspberry Pi and Amateur Radio
Kevin Hooke
 
Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Yoshiki Shibukawa
 
FPGA処理をROSコンポーネント化する自動設計環境
FPGA処理をROSコンポーネント化する自動設計環境FPGA処理をROSコンポーネント化する自動設計環境
FPGA処理をROSコンポーネント化する自動設計環境
Kazushi Yamashina
 

What's hot (17)

Introduction to IPython & Notebook
Introduction to IPython & NotebookIntroduction to IPython & Notebook
Introduction to IPython & Notebook
 
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
 
機器學習應用於蔬果辨識
機器學習應用於蔬果辨識機器學習應用於蔬果辨識
機器學習應用於蔬果辨識
 
DIY GPS Logger 20130413 #mbed_fest_w
DIY GPS Logger 20130413 #mbed_fest_wDIY GPS Logger 20130413 #mbed_fest_w
DIY GPS Logger 20130413 #mbed_fest_w
 
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
 
Tools for FPGA Development
Tools for FPGA DevelopmentTools for FPGA Development
Tools for FPGA Development
 
Inside Buzztter
Inside BuzztterInside Buzztter
Inside Buzztter
 
D1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FFD1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FF
 
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etcComparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
 
The str/bytes nightmare before python2 EOL
The str/bytes nightmare before python2 EOLThe str/bytes nightmare before python2 EOL
The str/bytes nightmare before python2 EOL
 
自律移動ロボット向けハード・ソフト協調のためのコンポーネント設計支援ツール
自律移動ロボット向けハード・ソフト協調のためのコンポーネント設計支援ツール自律移動ロボット向けハード・ソフト協調のためのコンポーネント設計支援ツール
自律移動ロボット向けハード・ソフト協調のためのコンポーネント設計支援ツール
 
Free Mobile - when Android is not enough
Free Mobile - when Android is not enoughFree Mobile - when Android is not enough
Free Mobile - when Android is not enough
 
Republic of IoT - Hackathon Hardware Kits Hands-on Labs
Republic of IoT - Hackathon Hardware Kits Hands-on LabsRepublic of IoT - Hackathon Hardware Kits Hands-on Labs
Republic of IoT - Hackathon Hardware Kits Hands-on Labs
 
uRock @ Jserv Course Final
uRock @ Jserv Course Final uRock @ Jserv Course Final
uRock @ Jserv Course Final
 
Raspberry Pi and Amateur Radio
Raspberry Pi and Amateur RadioRaspberry Pi and Amateur Radio
Raspberry Pi and Amateur Radio
 
Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014
 
FPGA処理をROSコンポーネント化する自動設計環境
FPGA処理をROSコンポーネント化する自動設計環境FPGA処理をROSコンポーネント化する自動設計環境
FPGA処理をROSコンポーネント化する自動設計環境
 

Similar to Micro Python で組み込み Python

Espruino - JavaScript for Microcontrollers
Espruino - JavaScript for MicrocontrollersEspruino - JavaScript for Microcontrollers
Espruino - JavaScript for Microcontrollers
Drew Fustini
 
CentOS 7 入門
CentOS 7 入門CentOS 7 入門
CentOS 7 入門
Shiojiri Ohhara
 
Python-in-Embedded-systems.pptx
Python-in-Embedded-systems.pptxPython-in-Embedded-systems.pptx
Python-in-Embedded-systems.pptx
TuynLCh
 
SoC Python Discussion Group
SoC Python Discussion GroupSoC Python Discussion Group
SoC Python Discussion Group
krishna_dubba
 
micro:bit and JavaScript
micro:bit and JavaScriptmicro:bit and JavaScript
micro:bit and JavaScript
Kenneth Geisshirt
 
Rusty Python
Rusty PythonRusty Python
Rusty Python
RangHo Lee
 
Qemu上でlagopusを動かした話
Qemu上でlagopusを動かした話Qemu上でlagopusを動かした話
Qemu上でlagopusを動かした話
Masaru Oki
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry PiLentin Joseph
 
DIY Home Smart Lighting System with Micropython - PyCon MY 2018
DIY Home Smart Lighting System with Micropython - PyCon MY 2018DIY Home Smart Lighting System with Micropython - PyCon MY 2018
DIY Home Smart Lighting System with Micropython - PyCon MY 2018
Tegar Imansyah
 
Raspberry Pi GPIO Tutorial - Make Your Own Game Console
Raspberry Pi GPIO Tutorial - Make Your Own Game ConsoleRaspberry Pi GPIO Tutorial - Make Your Own Game Console
Raspberry Pi GPIO Tutorial - Make Your Own Game Console
RICELEEIO
 
Dfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopDfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopTamas K Lengyel
 
Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs
sangam biradar
 
ScratchGPIO, Raspberry Pi & BerryClip
ScratchGPIO, Raspberry Pi & BerryClipScratchGPIO, Raspberry Pi & BerryClip
ScratchGPIO, Raspberry Pi & BerryClip
David Dryden
 
Python入門 : 4日間コース社内トレーニング
Python入門 : 4日間コース社内トレーニングPython入門 : 4日間コース社内トレーニング
Python入門 : 4日間コース社内トレーニング
Yuichi Ito
 
I made some more expansion board for M5Stack
I made some more expansion  board for M5StackI made some more expansion  board for M5Stack
I made some more expansion board for M5Stack
Masawo Yamazaki
 
BKK16-304 The State of GDB on AArch64
BKK16-304 The State of GDB on AArch64BKK16-304 The State of GDB on AArch64
BKK16-304 The State of GDB on AArch64
Linaro
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Introduction to ipython notebook
Introduction to ipython notebookIntroduction to ipython notebook
Introduction to ipython notebook
Go Asgard
 
Harry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of BerkeleyHarry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of Berkeley
Alex Chistyakov
 
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
Jeff Squyres
 

Similar to Micro Python で組み込み Python (20)

Espruino - JavaScript for Microcontrollers
Espruino - JavaScript for MicrocontrollersEspruino - JavaScript for Microcontrollers
Espruino - JavaScript for Microcontrollers
 
CentOS 7 入門
CentOS 7 入門CentOS 7 入門
CentOS 7 入門
 
Python-in-Embedded-systems.pptx
Python-in-Embedded-systems.pptxPython-in-Embedded-systems.pptx
Python-in-Embedded-systems.pptx
 
SoC Python Discussion Group
SoC Python Discussion GroupSoC Python Discussion Group
SoC Python Discussion Group
 
micro:bit and JavaScript
micro:bit and JavaScriptmicro:bit and JavaScript
micro:bit and JavaScript
 
Rusty Python
Rusty PythonRusty Python
Rusty Python
 
Qemu上でlagopusを動かした話
Qemu上でlagopusを動かした話Qemu上でlagopusを動かした話
Qemu上でlagopusを動かした話
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry Pi
 
DIY Home Smart Lighting System with Micropython - PyCon MY 2018
DIY Home Smart Lighting System with Micropython - PyCon MY 2018DIY Home Smart Lighting System with Micropython - PyCon MY 2018
DIY Home Smart Lighting System with Micropython - PyCon MY 2018
 
Raspberry Pi GPIO Tutorial - Make Your Own Game Console
Raspberry Pi GPIO Tutorial - Make Your Own Game ConsoleRaspberry Pi GPIO Tutorial - Make Your Own Game Console
Raspberry Pi GPIO Tutorial - Make Your Own Game Console
 
Dfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopDfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshop
 
Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs
 
ScratchGPIO, Raspberry Pi & BerryClip
ScratchGPIO, Raspberry Pi & BerryClipScratchGPIO, Raspberry Pi & BerryClip
ScratchGPIO, Raspberry Pi & BerryClip
 
Python入門 : 4日間コース社内トレーニング
Python入門 : 4日間コース社内トレーニングPython入門 : 4日間コース社内トレーニング
Python入門 : 4日間コース社内トレーニング
 
I made some more expansion board for M5Stack
I made some more expansion  board for M5StackI made some more expansion  board for M5Stack
I made some more expansion board for M5Stack
 
BKK16-304 The State of GDB on AArch64
BKK16-304 The State of GDB on AArch64BKK16-304 The State of GDB on AArch64
BKK16-304 The State of GDB on AArch64
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Introduction to ipython notebook
Introduction to ipython notebookIntroduction to ipython notebook
Introduction to ipython notebook
 
Harry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of BerkeleyHarry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of Berkeley
 
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
 

More from Hirotaka Kawata

KotlinConf 2018 から見る 最近の Kotlin サーバーサイド事情
KotlinConf 2018 から見る 最近の Kotlin サーバーサイド事情KotlinConf 2018 から見る 最近の Kotlin サーバーサイド事情
KotlinConf 2018 から見る 最近の Kotlin サーバーサイド事情
Hirotaka Kawata
 
本当にわかる Spectre と Meltdown
本当にわかる Spectre と Meltdown本当にわかる Spectre と Meltdown
本当にわかる Spectre と Meltdown
Hirotaka Kawata
 
ゼロから始める自作 CPU 入門
ゼロから始める自作 CPU 入門ゼロから始める自作 CPU 入門
ゼロから始める自作 CPU 入門
Hirotaka Kawata
 
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1Hirotaka Kawata
 
Introduction of PyCon JP 2014 in PyCon SG
Introduction of PyCon JP 2014 in PyCon SGIntroduction of PyCon JP 2014 in PyCon SG
Introduction of PyCon JP 2014 in PyCon SGHirotaka Kawata
 
自作コンピューターでなんかする - 第八回 カーネル/VM探検隊&懇親会
自作コンピューターでなんかする - 第八回 カーネル/VM探検隊&懇親会自作コンピューターでなんかする - 第八回 カーネル/VM探検隊&懇親会
自作コンピューターでなんかする - 第八回 カーネル/VM探検隊&懇親会
Hirotaka Kawata
 
産学間連携推進室(AC部屋) 2012 成果報告会
産学間連携推進室(AC部屋) 2012 成果報告会産学間連携推進室(AC部屋) 2012 成果報告会
産学間連携推進室(AC部屋) 2012 成果報告会Hirotaka Kawata
 
30日でできない!コンピューター自作入門 - カーネル/VM探検隊@つくば
30日でできない!コンピューター自作入門 - カーネル/VM探検隊@つくば30日でできない!コンピューター自作入門 - カーネル/VM探検隊@つくば
30日でできない!コンピューター自作入門 - カーネル/VM探検隊@つくば
Hirotaka Kawata
 
seccamp2012 チューター発表
seccamp2012 チューター発表seccamp2012 チューター発表
seccamp2012 チューター発表Hirotaka Kawata
 
Open Design Computer Project - Tsukuba.pm
Open Design Computer Project - Tsukuba.pmOpen Design Computer Project - Tsukuba.pm
Open Design Computer Project - Tsukuba.pmHirotaka Kawata
 
About University of Tsukuba Linux User Group
About University of Tsukuba Linux User GroupAbout University of Tsukuba Linux User Group
About University of Tsukuba Linux User Group
Hirotaka Kawata
 

More from Hirotaka Kawata (12)

KotlinConf 2018 から見る 最近の Kotlin サーバーサイド事情
KotlinConf 2018 から見る 最近の Kotlin サーバーサイド事情KotlinConf 2018 から見る 最近の Kotlin サーバーサイド事情
KotlinConf 2018 から見る 最近の Kotlin サーバーサイド事情
 
本当にわかる Spectre と Meltdown
本当にわかる Spectre と Meltdown本当にわかる Spectre と Meltdown
本当にわかる Spectre と Meltdown
 
ゼロから始める自作 CPU 入門
ゼロから始める自作 CPU 入門ゼロから始める自作 CPU 入門
ゼロから始める自作 CPU 入門
 
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
 
Introduction of PyCon JP 2014 in PyCon SG
Introduction of PyCon JP 2014 in PyCon SGIntroduction of PyCon JP 2014 in PyCon SG
Introduction of PyCon JP 2014 in PyCon SG
 
xv6 + mist32 + mruby
xv6 + mist32 + mrubyxv6 + mist32 + mruby
xv6 + mist32 + mruby
 
自作コンピューターでなんかする - 第八回 カーネル/VM探検隊&懇親会
自作コンピューターでなんかする - 第八回 カーネル/VM探検隊&懇親会自作コンピューターでなんかする - 第八回 カーネル/VM探検隊&懇親会
自作コンピューターでなんかする - 第八回 カーネル/VM探検隊&懇親会
 
産学間連携推進室(AC部屋) 2012 成果報告会
産学間連携推進室(AC部屋) 2012 成果報告会産学間連携推進室(AC部屋) 2012 成果報告会
産学間連携推進室(AC部屋) 2012 成果報告会
 
30日でできない!コンピューター自作入門 - カーネル/VM探検隊@つくば
30日でできない!コンピューター自作入門 - カーネル/VM探検隊@つくば30日でできない!コンピューター自作入門 - カーネル/VM探検隊@つくば
30日でできない!コンピューター自作入門 - カーネル/VM探検隊@つくば
 
seccamp2012 チューター発表
seccamp2012 チューター発表seccamp2012 チューター発表
seccamp2012 チューター発表
 
Open Design Computer Project - Tsukuba.pm
Open Design Computer Project - Tsukuba.pmOpen Design Computer Project - Tsukuba.pm
Open Design Computer Project - Tsukuba.pm
 
About University of Tsukuba Linux User Group
About University of Tsukuba Linux User GroupAbout University of Tsukuba Linux User Group
About University of Tsukuba Linux User Group
 

Recently uploaded

Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 

Recently uploaded (20)

Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 

Micro Python で組み込み Python

  • 1. Micro Python 䛷 ⤌䜏㎸䜏 Python @hktechno Hirotaka Kawata
  • 2. @hktechno ᕝ⏣ ⿱㈗ (䛛䜟䛯 䜂䜝䛯䛛) ● PyCon JP 2013-2014 Staff (Program Team) ● ⟃Ἴ኱Ꮫ 䝅䝇䝔䝮᝟ሗᕤᏛ◊✲⛉ 䝁䞁䝢䝳䞊䝍䝃䜲䜶䞁䝇ᑓᨷ ○ ಟኈ 1ᖺ ● Open Design Computer Project ○ 2011 ᮍ㋃IT䛺䜣䛸䛛 䝇䞊䝟䞊䜽䝸䜶䜲䝍䞊 ○ http://open-arch.org/
  • 3. Micro Python ● Python for microcontrollers ○ 䝬䜲䝁䞁䛷౑䛘䜛 Python ○ KICKSTARTER 䛷 97,803 GBP (⣙1500୓෇) ⋓ᚓ ● The pyboard ○ Micro Python ⏝䛾䝬䜲䝁䞁ᇶᯈ http://micropython.org/ 㠃ⓑ䛭䛖
  • 4. Micro Python ● Python 3 ஫᥮䛾 Python ฎ⌮⣔ ○ 䝬䜲䝁䞁ྥ䛡䛻෌ᐇ⿦ (CPython 䛷䛿䛺䛔) ○ 䝷䜲䝤䝷䝸䜒ᇶᮏⓗ䛺䜒䛾䛿౑䛘䜛 ● 䝬䜲䝁䞁ୖ䛷 Python 䛜ື䛟 ○ Arduino 䛾䜘䛖䛺ᡭ㍍䛥 ○ 䛧䛛䜒 Python 䛷᭩䛡䜛 ○ Python ෆ䛷䜲䞁䝷䜲䞁䜰䝉䞁䝤䝷䛜౑䛘䛯䜚... (!!) ● REPL 䜒౑䛘䜛 ○ 䝬䜲䝁䞁ୖ䛷䜲䞁䝍䝷䜽䝔䜱䝤䝅䜵䝹
  • 5. The pyboard ● Micro Python board ○ STM32F4 (Cortex-M4) ○ microSD slot ○ microUSB ○ Accelerometer ○ 4 LED ○ Switch… ● KICKSTARTER ○ $20 (early-bird price) ○ $24
  • 6. vs Raspberry Pi ● GPIO ○ Raspberry Pi 䛿䛱䜗䛳䛸ᑡ䛺䜑 ○ (Type B+ 䛷ᑡ䛧ቑ䛘䜎䛧䛯) ● Price ○ 3940෇... ● 㛤Ⓨ䛜㠃ಽ䛟䛥䛔 ○ Raspberry Pi 䛾 Linux 䛷㛤Ⓨ䛩䜛 or SSH ○ 䛭䜒䛭䜒䝬䜲䝁䞁䛷䛿䛺䛔...
  • 7. vs mruby ᛮ᝿䛾㐪䛔 ● mruby ○ ⤌䜏㎸䜏ᶵჾ䛷 C 䛛䜙 Ruby 䜢ᢅ䛖 ○ 䝋䝣䝖䜴䜵䜰䛻⤌䜏㎸䜏䜒䛷䛝䜛 (Lua 䛾䜘䛖䛺) ○ ୺䛻䚸䝞䜲䝖䝁䞁䝟䜲䝹䛧䛯䝞䜲䝘䝸䜢ᢞධ ● Micro Python ○ Python 䛷ᇶᮏⓗ䛻᏶⤖䛩䜛 ○ 䝬䜲䝁䞁䚸䝩䝡䞊⏝㏵ྥ䛡 ○ Python 䝇䜽䝸䝥䝖䜢᭩䛝㎸䜐 ○ REPL 䛷䜲䞁䝍䝷䜽䝔䜱䝤䛻䜒᧯సྍ⬟
  • 8. 䛧䛛䛧... ● pyboard 䛿⌧ᅾධᡭ୙ྍ⬟ ○ KICKSTARTER 䛾㉎ධศ䛿Ⓨ㏦῭䜏 ○ ḟ䛾䝻䝑䝖䜢⏕⏘䛩䜛䜙䛧䛔䠛 ○ 䛹䛱䜙䛻䛧䛶䜒䛩䛠䛻䛿ධᡭ୙ྍ⬟... ● ண䜑Ⓩ㘓䛧䛶䛒䛳䛯ே䛾ඛ⾜㈍኎䜒... ○ ᡭඖ䛻౑䛘䜛䜹䞊䝗䛜䛺䛟䛶Ỵ῭ኻᩋ ○ Out of stock! orz
  • 10. ᡭ㍍䛻 Micro Python ● STM32F4 Discovery ○ ST Micro ⣧ṇ䛾 STM32F407 ホ౯䝪䞊䝗 ○ ⛅᭶㟁Ꮚ㏻ၟ䛷 1,750 ෇ ● ᶵ⬟ ○ 192KB RAM ○ 1MB Flash ○ LED x 4 ○ Accelerometer ○ D-class AMP ○ Microphone ○ USB (mini + micro)
  • 11. STM32F4 Disvoery ‽ഛ ● Micro Python 䝉䝑䝖䜰䝑䝥᪉ἲ ○ https://github. com/micropython/micropython/wiki/Board- STM32F407-Discovery $ cd stmhal $ make BOARD=STM32F4DISC ● 䝣䜯䞊䝮䜴䜵䜰䜢᭩䛝᥮䛘䜛ᚲせ䛜䛒䜛 ○ BOOT0 - Vdd 䜢䝅䝵䞊䝖 ■ ⿬ഃ䛾䝆䝱䞁䝟䜢౑䛖䛸䜘䛔 (JP2, JP3) ○ DFU (dfu-util) 䛷 build/flash.dfu 䜢᭩䛝㎸䜏 ■ microUSB 䛾᪉䜢౑䛖䚹䛯䛰䛧㟁※౪⤥䛥䜜䛺䛔䛾䛷୧᪉่䛩䚹
  • 12. ᥋⥆䞉᭩䛝㎸䜏 ● USB 䝇䝖䝺䞊䝆䛸䛧䛶ㄆ㆑䛩䜛 ○ boot.py: ㉳ື᫬䛻ᐇ⾜䛥䜜䜛 ○ main.py: 䝯䜲䞁䝥䝻䜾䝷䝮 ○ 䝋䞊䝇 (main.py) 䜢䝁䝢䞊䛩䜛䛰䛡䛷Ⰻ䛔 ○ ⮬ศ䛷స䛳䛯䝰䝆䝳䞊䝹䜒᭩䛝㎸䜏䞉฼⏝䛷䛝䜛 ● REPL 䜢❧䛱ୖ䛢䜛 ○ USB ௬᝿䝅䝸䜰䝹䝫䞊䝖䜒స䜙䜜䜛 ■ Linux 䛾ሙྜ /dev/ttyACM0 ○ ᥋⥆䛩䜛䛸 Micro Python REPL 䝅䜵䝹䛜౑䛘䜛
  • 13. pyb Module ● pyboard 䜢᧯స䛩䜛䝰䝆䝳䞊䝹 ○ pyb.Pin ○ pyb.LED ○ pyb.Switch ○ pyb.SPI ○ pyb.I2C ○ pyb.UART... ○ http://micropython.org/doc/module/pyb/ ● pyboard ྥ䛡䛰䛜... ○ Discovery 䝪䞊䝗䛷䜒୍㒊䛿฼⏝ྍ⬟
  • 14. Micro Python REPL ● Python 䛾 REPL 䛸䜋䜌ྠ䛨 ○ 䜲䞁䝍䝷䜽䝔䜱䝤䛻䝬䜲䝁䞁䜢᧯స䛷䛝䜛 ○ 䝕䝞䝑䜾䛻౽฼ ○ 䝰䝆䝳䞊䝹䜢᭩䛝㎸䜣䛷䛚䛡䜀䚸䛭䜜䜒౑䛘䜛 ● Ctrl-D 䛷 soft-reset ○ main.py 䜔䝰䝆䝳䞊䝹䜢᭩䛝᥮䛘䛯᫬䛻౑䛖 ● Ctrl-C 䛷 interrupt ○ main.py 䛾ᐇ⾜䜢Ṇ䜑䜛
  • 15. LED ON / OFF ● 䛸䜚䛒䛘䛪 L 䝏䜹 led = pyb.LED(1) while True: led.off() pyb.delay(500) led.on() pyb.delay(500) 䛣䜜䛷䜒䜘䛔 led = pyb.LED(1) while True: led.toggle() pyb.delay(500)
  • 16. Switch ● Switch 䛷 Callback 䛜౑䛘䜛 def toggle(): pyb.LED(1).toggle() pyb.delay(10) sw = pyb.Switch() sw.callback(toggle)
  • 17. GPIO ● pyb.Pin 䜢౑䛖 pin = pyb.Pin(pyb.Pin.board.PD2, pyb.Pin.OUT_PP) pin.high() pin.low() pin_value = pin.value() pin.value(False) # => pin.low()
  • 18. STM32F4DISC STAccel ● 䠎✀㢮䛾ຍ㏿ᗘ䝉䞁䝃䞊 ○ 䝪䞊䝗䛾䝻䝑䝖䛻䜘䛳䛶㐪䛖 ○ LIS302DL (ྂ䛔) ○ LIS3DSH (᪂䛧䛔, 㧗ᶵ⬟) ● staccel.py : STAccel # pyb.Accel 䛿 pyboard ᑓ⏝ ○ ᡭ㍍䛻ຍ㏿ᗘ䝉䞁䝃䜢ᢅ䛘䜛䝰䝆䝳䞊䝹 ○ stmhal/boards/STM32F4DISC/staccel.py ○ LIS3DSH ᑐᛂ䝟䝑䝏䜢ᢞ䛢䛶 merge 䛥䜜䛯 ○ https://github.com/micropython/micropython/pull/852
  • 19. LCD ᕷ㈍䛾 LCD 䜢౑䛖 # pyb.LCD 䛿䚸pyboard ᑓ⏝ ● SC1602 䝅䝸䞊䝈 (ᐃ␒䛾䜰䝺) ○ ⛅᭶㟁Ꮚ㏻ၟ䛷኎䛳䛶䜎䛩 ○ 䝞䝑䜽䝷䜲䝖䛺䛧䛷䛒䜜䜀 500 ෇䛛䜙 ● Python 䛷 LCD 䝗䝷䜲䝞䜢᭩䛔䛶䜏䜎䛧䛯 ○ https://github.com/techno/micropython_modules ○ sc1602.py
  • 21. Performance ● (ᙜ䛯䜚๓䛰䛡䛹) ⤖ᵓ㐜䛔 ○ Teensy 3.1 (96MHz ARM) ○ C++ (Arduino like) 䛸䛟䜙䜉䛶䚸⣙ 100 ಸ㐜䛔 ○ https://github. com/micropython/micropython/wiki/Performance ● Arduino 䛷༑ศ䛺⏝㏵䛺䜙ၥ㢟䛻䛺䜙䛺䛔 ○ Arduino Pro Mini (C++) 䛛䜙ẚ䜉䛶4ಸ䛠䜙䛔 ○ 䛫䛳䛛䛟㏿䛔䜽䝻䝑䜽ᩘ䛿↓㥏䛻䛺䜛䛜...
  • 22. Inline Assembly 䜲䞁䝷䜲䞁䜰䝉䞁䝤䝷䛾౛ @micropython.asm_thumb def asm_add(r0, r1): add(r0, r0, r1)
  • 23. Development Sprint ● 14᪥ Development Sprint 䜔䜚䜎䛩 ○ http://pyconjp.connpass.com/event/8105/ ● Micro Python Sprint ○ ゐ䛳䛯䛣䛸䛺䛔ே䛷䜒 OK ○ STM32F4 Discovery 䝪䞊䝗䜢ᣢ䛳䛶䛟䜛䛸 Better ● 䜔䜚䛯䛔䛣䛸䛸䛛 ○ 䝪䞊䝗ᦚ㍕䛾D⣭䜰䞁䝥䞉䝬䜲䜽䛾䝗䝷䜲䝞 ○ ௚䛾䝪䞊䝗䜈⛣᳜
  • 24. ௚䛾䝬䜲䝁䞁䜈䛾⛣᳜ ● GR-SAKURA 䜈⛣᳜䜢ヨ䜏䛯 ○ Renesas RX63N ● 㐍ᤖ ○ 䜲䞁䝍䝥䝸䝍䛿ື䛔䛯 ○ print 䛿䛷䛝䜛 ○ 䜎䛰: pyb 䝰䝆䝳䞊䝹 ○ 䜎䛰: REPL ⤖ㄽ: 䜎䛰STM32௨እ䛻⛣᳜䛩䜛䛾䛿኱ኚ䛭䛖 ⯆࿡䛜䛒䛳䛯䜙 Sprint or Office hour 䛷...
  • 25. 䜎䛸䜑 ● Micro Python 䛺䛛䛺䛛䜘䛥䛭䛖 ○ 䛯䛰䛧䚸䜎䛰䜎䛰ᨵၿ䛾వᆅ䛜䛒䜚䛭䛖 ○ ௚䛾䝪䞊䝗䜈䛾⛣᳜䛻ᮇᚅ ● Raspberry Pi ౑䛳䛯䜋䛖䛜Ⰻ䛥䛭䛖䛺⏝㏵ ○ 䝛䝑䝖䝽䞊䜽 ○ Wi-Fi, Bluetooth ○ USB… 䝪䞊䝗䛰䛡䛷᏶⤖䛩䜛䛺䜙 Micro Python䟿