Hello, I need to work with 2 metawear devices from an android cell phone, I don't know if they can indicate or help me with a program, since it is for a job titling
The things I want to know is about the part of the code that allows the device to connect 2 boards. Also, I want to know how in which part of the code we start the data transmision.
Thanks, I already have the two communications of the devices metawear, I am currently reading the data of the accelerometer you can help me indicating how I could do to read the data also of the gyroscope since I put it inside the same function of the accelerometer and it did not work, Thank you
Comments
return accelModule.acceleration().addRouteAsync(new RouteBuilder() {
@Override
public void configure(RouteComponent source) {
source.stream(new Subscriber() {
@Override
public void apply(final Data data, Object... env) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Log.i("MainActivity", data.value(Acceleration.class).toString());
newDeviceState.gyra= data.value(Acceleration.class).toString();
connectedDevices.notifyDataSetChanged();
}
});
}
});
}
});
}
}).onSuccessTask(new Continuation<Route, Task<Route>>() {
@Override
public Task<Route> then(Task<Route> task) throws Exception {
return newBoard.getModule(Switch.class).state().addRouteAsync(new RouteBuilder() {
@Override
public void configure(RouteComponent source) {
source.stream(new Subscriber() {
@Override
public void apply(final Data data, Object... env) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
newDeviceState.pressed = data.value(Boolean.class);
connectedDevices.notifyDataSetChanged();
}
});
}
});
}
});