Enviar pesquisa
Carregar
MicroPython に手出してみないか?
•
Transferir como PPTX, PDF
•
0 gostou
•
754 visualizações
Minoru Inachi
Seguir
でじぽろ #13 LT での MicroPython 紹介資料
Leia menos
Leia mais
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 27
Baixar agora
Recomendados
C++のライブラリを簡単に眺めてみよう
C++のライブラリを簡単に眺めてみよう
Hiro H.
C#/Java & Linux で始める ET ロボコン(leJOS編)
C#/Java & Linux で始める ET ロボコン(leJOS編)
Minoru Inachi
Boost.勉強会 #21 札幌「C++1zにstring_viewが導入されてうれしいので紹介します」
Boost.勉強会 #21 札幌「C++1zにstring_viewが導入されてうれしいので紹介します」
Hiro H.
関数の最小値を求めることから機械学習へ
関数の最小値を求めることから機械学習へ
Hiro H.
ヒューマンコンピュテーションのための専門家発見(ステアラボ人工知能シンポジウム2017)
ヒューマンコンピュテーションのための専門家発見(ステアラボ人工知能シンポジウム2017)
STAIR Lab, Chiba Institute of Technology
自然言語処理分野の最前線(ステアラボ人工知能シンポジウム2017)
自然言語処理分野の最前線(ステアラボ人工知能シンポジウム2017)
STAIR Lab, Chiba Institute of Technology
How to make GAE adapt the Great Firewall
How to make GAE adapt the Great Firewall
Hayato Yoshikawa
JSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFE
Hiroyuki Anai
Recomendados
C++のライブラリを簡単に眺めてみよう
C++のライブラリを簡単に眺めてみよう
Hiro H.
C#/Java & Linux で始める ET ロボコン(leJOS編)
C#/Java & Linux で始める ET ロボコン(leJOS編)
Minoru Inachi
Boost.勉強会 #21 札幌「C++1zにstring_viewが導入されてうれしいので紹介します」
Boost.勉強会 #21 札幌「C++1zにstring_viewが導入されてうれしいので紹介します」
Hiro H.
関数の最小値を求めることから機械学習へ
関数の最小値を求めることから機械学習へ
Hiro H.
ヒューマンコンピュテーションのための専門家発見(ステアラボ人工知能シンポジウム2017)
ヒューマンコンピュテーションのための専門家発見(ステアラボ人工知能シンポジウム2017)
STAIR Lab, Chiba Institute of Technology
自然言語処理分野の最前線(ステアラボ人工知能シンポジウム2017)
自然言語処理分野の最前線(ステアラボ人工知能シンポジウム2017)
STAIR Lab, Chiba Institute of Technology
How to make GAE adapt the Great Firewall
How to make GAE adapt the Great Firewall
Hayato Yoshikawa
JSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFE
Hiroyuki Anai
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Mais conteúdo relacionado
Destaque
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Destaque
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
MicroPython に手出してみないか?
1.
MicroPythonに 手出してみないか? でじぽろ #13
2.
自己紹介 札幌駅北口前のとあるソフトウェア会社のソ フトウェアエンジニア 昨年から業務でPython使い出す Python Boot Camp
in 札幌に参加 PyCon mini hiroshima のスライド眺めていて 、MicroPythonネタにはまりこむ
3.
MicroPython マイコン用に再実装したPython、OS要らず CPythonよりも小さく、効率がよい 言語としてはPython3.4とほぼ互換 軽量pythonとして組込みLinux上でも使われ ていたりする(OpenWrtなど)
4.
https://micropython.org/
5.
Lチカ from machine import
Pin from time import sleep_ms led = Pin(0, Pin.OUT) while True: led.value(1) sleep_ms(500) led.value(0) sleep_ms(500)
6.
7.
鮨を廻す from machine import
* from ssd1306 import * import time class RollingSushi: icon = [ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0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1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0], [0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,0,0,0], [0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,0,0,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], ] def __init__(self): self.i2c = I2C(sda=Pin(25),scl=Pin(26)) self.lcd = SSD1306_I2C(128, 64, self.i2c) self.x0 = 0 self.y0 = 0 self.xlen = len(RollingSushi.icon[0]) self.ylen = len(RollingSushi.icon) self.xmax = 128 - self.xlen self.ymax = 64 - self.ylen self.direction = 0 self.lcd.init_display() self.lcd.show()
8.
def __init__(self): self.i2c =
I2C(sda=Pin(25),scl=Pin(26)) self.lcd = SSD1306_I2C(128, 64, self.i2c) self.x0 = 0 self.y0 = 0 self.xlen = len(RollingSushi.icon[0]) self.ylen = len(RollingSushi.icon) self.xmax = 128 - self.xlen self.ymax = 64 - self.ylen self.direction = 0 self.lcd.init_display() self.lcd.show() def draw_image(self): for y in range(self.ylen): for x in range(self.xlen): self.lcd.pixel(self.x0+x,self.y0+y,RollingSushi.icon[y][x]) self.lcd.show() if self.direction == 0: for y in range(self.ylen): self.lcd.pixel(self.x0, self.y0+y,0) if self.x0 >= self.xmax: self.direction = 1 else: self.x0 += 1 elif self.direction == 1: for x in range(self.xlen): self.lcd.pixel(self.x0+x, self.y0,0) if self.y0 >= self.ymax: self.direction = 2 else: self.y0 += 1 elif self.direction == 2: for y in range(self.ylen): self.lcd.pixel(self.x0+x+self.xlen-1, self.y0+y,0) if self.x0 <= 0: self.direction = 3 else: self.x0 -= 1 else: for x in range(self.xlen): self.lcd.pixel(self.x0+x, self.y0+self.ylen-1,0) if self.y0 <= 0: self.direction = 0 else: self.y0 -= 1
9.
sushi = RollingSushi() while
True: sushi.draw_image()
10.
11.
どんなもので動く?
12.
pyboard
13.
STM32F4 Discovery
14.
ESP8266 (ESP-WROOM-02)
15.
ESP32 (ESP-WROOM-32)
16.
Teensy
17.
ARDUINO M0
18.
wipy
19.
どれも、ちょっと敷居が高いな ラズパイで普通のPython動かすのでよくね?
20.
21.
chibi:bit 英国で100万台を小学校高学年に無料配布した micro:bit の互換機 スイッチサイエンスから3,456円で販売 Cortex-M0、256KB Flash
ROM、16KB RAM 5x5マトリクスLED、ボタンx2、 加速度センサ、コンパスセンサー、BLE 開発環境はWebブラウザ上で使える ファームウェアのインストールとか小難しいこと不要
22.
コレ! http://microbit.org
23.
24.
GPIOもそれなりに
25.
muエディタ
26.
Jupyter
27.
まとめ MicroPythonはマイコン向けにPython3を再実 装したもの 組込み開発の経験がないなら micro:bit からは じめるのが一番やさしい 組込み開発の経験があるならESP8266が低価 格で入手しやすい 質問などは懇親会、「Python
札幌」 Slack で http://python-sapporo.github.io/
Baixar agora