最近話題になってるM5StackにはBluetoothモジュールが標準で付いてます。 これ一個あればUnityで開発できるゲームの幅が広がるなぁと思い、Unityと通信しようとすると結構つまずいたので、方法を共有しようと思います。 この記事内では、M5Stackで取得した情報を、Bluetoothシリアル通信でPCに送ってUnityで取得するまでをやります。 ---開発環境--- Unity2018.2.15f1 M5Stack Basic Arduino IDE 1.8.7 UniRx M5Stack側準備 Bluetooth通信回りは、BluetoothSerial.hというライブラリを使ってやります。 M5Stackの最初のセットアップでこのライブラリは追加されていると思いますが、見つからない場合はインストールしなおしてください。 下のプログラムはM5Stackで0から255までの数