前回、WSLにpxt-microbitを入れてみたものの、どうにも動作しそうにない?ので、素直にWindows10環境に構築してみます。node関連のソースはnode_modulesを削除して再構築します。
- node.js npm
- yotta
- python2系
- cmake
がWindows10環境にインストールされており、なおかつPATHが通っていることが前提。
npm install
関連は、前回の投稿のままです。
SRecordもビルドエラーの原因だったのでインストールしてPATHに利かせる為、yottaのフォルダにでも入れておく。
なかなかyottaのビルドが実行されてもうまく動作しなかったが、yottaのインストールフォルダにあるrun_yotta.bat
を実行すると、yottaのビルド環境のパスが利いた状態のコマンドプロンプトが起動するので、ここからpxt-microbitに移動して、ビルドを実行したところ、どうにかビルドが動作するようになった。
> pxt serve
:
building libs\blocksprj
*** yotta build
:
*** yotta target bbc-microbit-classic-gcc
info: get versions for bbc-microbit-classic-gcc
info: download bbc-microbit-classic-gcc@0.2.3 from the public module registry
info: get versions for mbed-gcc
info: download mbed-gcc@0.1.3 from the public module registry
*** yotta update
info: get versions for bbc-microbit-classic-gcc
info: get versions for mbed-gcc
info: get versions for microbit
info: download microbit@v2.0.0-rc11 from GitHub lancaster-university/microbit
info: get versions for microbit-dal
info: download microbit-dal@v2.0.0-rc10 from GitHub lancaster-university/microbit-dal
info: get versions for mbed-classic
info: download mbed-classic@microbit_hfclk+mb6 from GitHub lancaster-university/mbed-classic
:
ビルドが終わると、サーバーが起動してWindows10環境だとブラウザも起動します。
ちなみにOSXでもビルド、サーバー起動まで確認できた。足りないツールやライブラリなどは基本的にbrew
コマンドでインストールすればOKで、苦労するポイントはなかった。
あと、ブラウザでシークレットモードで起動しているChromeで実行すると、サーバーは起動するけど、プログラムの保存やコンパイルなどに失敗する模様。
しかし、最初にWSLでやろうとしたのがいけなかった。ハマりまくった。
Playground
パズルのピースみたいなブロックをPlayground形式で確認しながら作成できる。