無印のPicoではなく「Raspberry Pi Pico W」向けの新しい開発プロジェクトの作り方の紹介です。 ベースとなるのは、ラズパイの[公式C/C++ SDKドキュメントページ](https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html) で紹介されている[「Getting started with Raspberry Pi Pico-series」という名前のPDF](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf) の「Manually Create your own Project」の項目で紹介されている無印Pico向けのやり方です。 この無印Pico向けから変えるのは、まずtest.cの中身を[pico-examples/blink/blink.c](https://github.com/raspberrypi/pico-examples/blob/master/blink/blink.c)の中身とすることです。前述のPDFのtest.cはPico Wに対応していないので、Pico Wに対応しているこのblink.cのコードに差し替えます。 次に、 CMakeLists.txtでは、PDFの内容に以下の記述を追加します。ちなみに、この追加は前述の[pico-examples/blink/のCMakeLists.txt](https://github.com/raspberrypi/pico-examples/blob/master/blink/CMakeLists.txt)を参考にしています。 ``` if (PICO_CYW43_SUPPORTED) target_link_libraries(test pico_cyw43_arch_none) endif() ``` 最後に、一連のビルドコマンドの中で、以下のようにcmakeのところで`-DPICO_BOARD=pico_w`オプションを付けます。ちなみにこれは、「Manually Create your own Project」の項目で付けるように書かれています。 ``` mkdir build cd build export PICO_SDK_PATH=../../pico-sdk cmake .. -DPICO_BOARD=pico_w make ``` 以上でPico Wに書き込むためのtest.uf2が出来るはずですので、これを実際に書き込んでLEDが点滅したら成功です。