Thonny

Raspberry Pi PicoにMicroPythonのプログラムを書き込むには Thonny というアプリを使います。

Thonnyのインストール

Thonnyのホームページを開きます。

Thonny



Windows版のダウンロードのリンクをクリックします。

_images/thonny-1.png

Install for me only をクリックします。

_images/thonny-2.png

Next をクリックします。

_images/thonny-3.png

I accept the agreement を選択してから、 Next をクリックします。

_images/thonny-4.png

Next をクリックします。

_images/thonny-5.png

Next をクリックします。

_images/thonny-6.png

Next をクリックします。

_images/thonny-7.png

Install をクリックします。

_images/thonny-8.png

インストールが始まります。

_images/thonny-9.png

Finish をクリックします。

_images/thonny-10.png

MicroPythonのアプリをRaspberry Pi Picoに書き込み

Thonnyを起動し、ウインドウの右下をクリックし、 Configure interpreter をクリックします。

_images/thonny-30.png

MicroPython (Raspberry Pi Pico)USB シリアルデバイス を選択してから、 OK をクリックします。

_images/thonny-31.png

画面右上の中止ボタンを押すと、Raspberry Pi Picoと接続してPythonのプロンプトが表示されます。

_images/thonny-32.png

アプリのソースの picomain.py を適当なエディタで開き、コードをすべて選択してコピーします。

_images/thonny-33.png

Thonnyのエディタ部分にコードを貼り付けます。

_images/thonny-34.png

ツールバーの Save ボタンをクリックすると、ダイアログが表示されるので Raspberry Pi Pico をクリックします。

_images/thonny-35.png

main.py というファイル名で保存します。

_images/thonny-36.png

Thonnyを終了してから、Raspberry Pi PicoのUSBをはずして挿入しなおすと、書き込んだmain.pyが自動的に実行されます。