Thonny ============================== Raspberry Pi PicoにMicroPythonのプログラムを書き込むには **Thonny** というアプリを使います。 .. _install_Thonny: Thonnyのインストール ---------------------------------- Thonnyのホームページを開きます。 `Thonny `_ ---- | Windows版のダウンロードのリンクをクリックします。 .. image:: ../img/thonny/thonny-1.png ---- | **Install for me only** をクリックします。 .. image:: ../img/thonny/thonny-2.png ---- | **Next** をクリックします。 .. image:: ../img/thonny/thonny-3.png ---- | **I accept the agreement** を選択してから、 **Next** をクリックします。 .. image:: ../img/thonny/thonny-4.png ---- | **Next** をクリックします。 .. image:: ../img/thonny/thonny-5.png ---- | **Next** をクリックします。 .. image:: ../img/thonny/thonny-6.png ---- | **Next** をクリックします。 .. image:: ../img/thonny/thonny-7.png ---- | **Install** をクリックします。 .. image:: ../img/thonny/thonny-8.png ---- | インストールが始まります。 .. image:: ../img/thonny/thonny-9.png ---- | **Finish** をクリックします。 .. image:: ../img/thonny/thonny-10.png | .. _write_app: MicroPythonのアプリをRaspberry Pi Picoに書き込み ------------------------------------------------- Thonnyを起動し、ウインドウの右下をクリックし、 **Configure interpreter** をクリックします。 .. image:: ../img/thonny/thonny-30.png ---- | **MicroPython (Raspberry Pi Pico)** と **USB シリアルデバイス** を選択してから、 **OK** をクリックします。 .. image:: ../img/thonny/thonny-31.png ---- | 画面右上の中止ボタンを押すと、Raspberry Pi Picoと接続してPythonのプロンプトが表示されます。 .. image:: ../img/thonny/thonny-32.png ---- | アプリのソースの **pico\main.py** を適当なエディタで開き、コードをすべて選択してコピーします。 .. image:: ../img/thonny/thonny-33.png ---- | Thonnyのエディタ部分にコードを貼り付けます。 .. image:: ../img/thonny/thonny-34.png ---- | ツールバーの **Save** ボタンをクリックすると、ダイアログが表示されるので **Raspberry Pi Pico** をクリックします。 .. image:: ../img/thonny/thonny-35.png ---- | **main.py** というファイル名で保存します。 .. image:: ../img/thonny/thonny-36.png ---- | Thonnyを終了してから、Raspberry Pi PicoのUSBをはずして挿入しなおすと、書き込んだmain.pyが自動的に実行されます。