LoginSignup
7
8

More than 5 years have passed since last update.

Web Bluetooth APIでArduino 101とブラウザを直接つなぐ

Posted at

Google Chromeのバージョン56からWeb Bluetooth APIが正式にリリースされたので、BLEでセンサーの値を飛ばすデバイスを作って試してみました。

試したこと

Arduino 101の内蔵IMUから加速度センサ3軸の値を読み取り、BLEで送信する。Chromeは、受信した各軸の値をグラフに描画する。

試した環境

  • macOS 10.12.3
  • Chrome 56.0.2924.87
  • Arduino (Genuino) 101
    • BLEと6軸センサーがあらかじめ載っているので、ハンダ付けの手間がなく楽だった。

手順

こちらのリポジトリにまとめています。

  1. Arduino 101にCurieIMU.inoを書き込みます
  2. Arduino 101を起動させておく
  3. index.htmlをChromeで開く。localhostのWebサーバか、file://として開く。
  4. Start Notificationsのボタンを押す

結果

Arduinoを動かすとグラフ描画に反映される様子

7
8
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
7
8