PiBleMobile Design Tips
PiBleMobile is an adapter interface tool for transfer from Raspberry Pi to Unity via an Android mobile phone using BLE (Bluetooth low energy). By connecting to the sensors device (gyro, accelerometer, GPS, etc.) with Raspberry Pi, Unity can input various data from the sensors device. This design tip explains the transfer method to Unity by referencing Raspberry Pi and Unity sample code in the purchased asset.
1. How to set up data in Raspberry Pi
Python script ”pible.py” generates 3D Object tilt data “x, y, z” with the sin function, then store in variable “x” and “y”. When you connect your sensors device, you need to change this code according to the input means from sensors.
2. How to get data from Raspberry Pi in Unity
Unity script ”PiBleSampleCode.cs” receives BLE data from Raspberry Pi as string data “str” of return value of “obj.Call