This series of articles will explain how to use The Tactigon’s integrated sensors and communication interfaces to create a simple gesture controller.
In this article we’re going to learn how to use simple Tactigon’s functions to send accelerometer data and quaternions over Bluetooth Low Energy (BLE from now on).
We’ll look at, in details, to:
- Why Processing?
- Used Libraries
- UUID and Characteristic
- Connection To Device
- Get Data Stream
- Final Considerations
We choose processing because it’s a diffuse software sketchbook, simple and easy to start with. It offers Java and Android compatiblity, and usually it’s possible to port an application from Java to Android with little to no change in coding.
A lot of hobbyists use Processing, so it’s easy to find support, sketches and libraries, as well as in depth tutorials and communities.
This example uses few essential libraries:
We’ll focus on Blepdroid while other libraries are not the aim of this post.
This library is developed specifically for Processing, in Android environment.
Blepdroid is available at:
As we have seen in previous part, we send data from our Tactigon board with a specific UUID. We have to use the same Identifier in this code, to be able to intercept it and read associated Characteristic value.
This is the static String declaration:
public static String TACTIGON_QUAT_CHAR_STRING = “7ac71000-503d-4920-b000-acc000000001”;
The onDeviceDiscovered() function verify if the BLE device discovered is The Tactigon board or another one.
To listen to the characteristic, we have to call for onServiceDiscovered(). This function scans for available Characteristic and, if available, set the listener to the one with TACTIGON_QUAT_UUID uuid.