0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Raspberry Pi Picoの初期設定

Last updated at Posted at 2023-03-15

初期設定で詰まったので備忘録として。
Raspberry Pi Pico、以下ラズパイピコと略

①MicroPythonをインストール

ここ (https://www.raspberrypi.com/documentation/microcontrollers/micropython.html) から"MicroPython"のファームウェアをインストールします。

②Thonnyをインストールする

1, ここ (https://thonny.org/) からThonnyをインストールする。
2, Thonnyを起動して最後の言語設定は、"Language"は"日本語"、"Initial Setting"は"Standard"を選択する。
3, 起動したら、[ツール]-[オプション]-[インタプリタ]で、
"Thonny はコードの実行にどのインタプリタまたはデバイスを使用すればよいですか?"は"MicroPython (Raspberry Pi Pico)"を選択し、
"ポート"は"USBシリアルデバイス(COM)"を選択する

③ラズパイピコとパソコンを接続する

1, ラズパイピコのBOOTSELボタンを押しながらパソコンに接続する。
2, パソコンにラズパイピコが認識されるのでそこに①でインストールしたUF2ファイルをドラッグ&ドロップする。
3, コピーが完了したら再起動されるので、ラズパイピコをパソコンから抜いてもう一度再接続する。

④プログラムを書いてみる

main.py
import machine
import utime
led = machine.Pin(25, machine.Pin.OUT)
while True:
    led.value(1) #点灯
    utime.sleep(5) #5秒待機
    led.value(0) #消灯
    utime.sleep(1) #1秒待機

保存先に[This computer]と[Raspberry Pi Pico]が選べるので[Raspberry Pi Pico]を選んでファイル名をmain.pyにして保存すると外部電源に接続したときに起動する。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?