Sphero の環境設定 (Mac OS X 編)
Owner & Collaborators
License
![](/assets/cc/by-nc-ddec4574197a1faec01e57f64e65bf1c5903ee7a1c67e73c71e4db9e14c7d1b7.png)
Sphero の環境設定 (Mac OS X 編) by Comozilla is licensed under the Creative Commons - Attribution-NonCommercial license.
Summary
Mac OS X から Node.js を叩いて Bluetooth 使って Sphero を動かします。
![](/assets/icons/share-20ae092651324b0ed71e6f35153c99f57ae05ade83f9b3579ad7c26e922e7b52.png)
Materials
Tools
Blueprints
Making
- PC から Sphero を動かすためのサンプルプログラムを作成します。
- ターミナルを立ち上げ、以下のコマンドを順に実行する。
$ mkdir mySphero
$ cd mySphero
$ npm install sphero$ npm install serialport
- Sphero を二回叩いて待機状態にする。
(Sphero 本体の色が三色に交互に変化すれば良い)
その後、 Mac の Bluetooth をオンにして Sphero と一度ペアリングする。
すると、ターミナルで以下のようにうつと、 Sphero のポート名が返ってくる。
$ ls /dev/tty.Sphero*
- hello.js の 3 行目、<ポート名> となっているところを先ほど確認したものに変更する。
- ターミナルで以下を実行する。
$ node hello.js
References
Usages
Project comments
- As long as you find the answer Connections NYT every day, you are worthy of being a genius.
![](/assets/loading-76d3480d6cfbd92ac2e356aacdd74ad155c7516f783d3e4af81bb94bf32bb69f.gif)
Comments