ソースコードを綺麗に整形して表示できるように、Githubも勉強してアカウントを作成し、使い方を覚えました。
Lチカの状況を動画でblogに張るために、動画編集ソフトを自宅のWindowsマシンにインストールし、スマホで撮った動画を編集しました。非力なマシンなので結構つらいものがあります。Youtubeページで少し前までは編集できたようですが、サービス終了とのこと。
今回は、blogの中身薄いですが手間は結構かかってます。
定番の「Lチカ」IO4ポートに抵抗入りLEDを接続。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import machine | |
import time | |
pin = machine.Pin(4, machine.Pin.OUT) #最初の引数がPin番号 | |
for i in range(10): | |
pin.value(0) | |
time.sleep(0.1) | |
pin.value(1) | |
time.sleep(0.1) |
LEDをPWMにて明るさ制御する(俗称「Lモア」)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import machine | |
pwm = machine.PWM(machine.Pin(4)) #この数字が出力Pin番号 | |
pwm.freq(60) | |
while True: | |
for i in range(1024): | |
pwm.duty(i) | |
time.sleep(0.001) | |
for i in range(1023, -1, -1): | |
pwm.duty(i) | |
time.sleep(0.001) |
状況の動画です。LチカからのLモア(手ブレあり)です。
あとは、
ちょっと脱線して、小さいLCDへの出力です。
●aqm1602y-rn-gbw python
http://www.takunoko.com/blog/aqm1602xa-rn-gbw%E3%82%92raspberry-pi%E3%81%A7%E4%BD%BF%E3%81%86/
http://kaizou55.blog84.fc2.com/blog-entry-5.html
今回は間に合いそうにないので、また次回に。
0 件のコメント:
コメントを投稿