LoginSignup
0
0

More than 1 year has passed since last update.

【toio.js】toio.jsの公式のサンプルをWindowsで動かす方法

Posted at

必要なもの

 Windowsで動かす場合にはBluetooth4.0に対応したアダプタが必要になる。私はAmazonでBluetooth USBアダプタを購入した。

image.png

事前にインストールするもの

1. python

 https://www.python.org/ からpythonをインストールする。このときにAdd Python 3.x to PATHを必ずインストールする。

2. Zading

 Zadingを使って汎用USBドライバーをインストールする。https://zadig.akeo.ie/ からインストールする。

image.png

手順

1. Zading Toolで汎用USBドライバーの適用をする

 インストールしたzading-2.5.exeを起動する。

image.png

 optionsからList All Devicesを選択する。Reinstall Driverをクリックする。

image.png

 successfullyと出たら完了。

image.png

2. toio.jsを動かす

2-1. toio.jsの公式サンプルをクローンする

 (gitが入っていない場合はzipでダウンロードする)

ターミナル
git clone https://github.com/toio/toio.js.git

2-2. node-bluetooth-hci-socketをダウンロードする

 toio.jsの中でnode-bluetooth-hci-socketをダウンロードする。

ターミナル
cd toio.js
git clone https://github.com/noble/node-bluetooth-hci-socket.git
npm install bluetooth-hci-socket

2-3. 実行する

 toioCubeの電源を入れて、パソコンのBluetoothをオンにしてサンプルを実行する。

ターミナル
yarn install
yarn build
yarn example:id-reader // マットのidを取得する
yarn example:keyboard-control // キーボードでcubeを操作する
yarn example:chase // 1つのcubeをもう1つのcubeが追いかける
0
0
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
0