Using the Button on the C
Hi all,
I have trouble to use the button on the C board - below code does not work and it will be a super simple solution, I know.
public void enableButton()
{
try {
Switch button = mwBoard.getModule(Switch.class);
Log.i("MainActivity", "Got Button, enabling...");
button.routeData().fromSensor().monitor(new DataSignal.ActivityHandler() {
@Override
public void onSignalActive(Map<String, DataProcessor> map, DataSignal.DataToken dataToken) {
Log.i("MainActivity", "Button pressed.");
}
});
} catch (UnsupportedModuleException e) {
e.printStackTrace();
}
}
I am using the Android code on a Nexus 5X, I hope there are no device issues.
This discussion has been closed.
Comments