Skip to content

Instantly share code, notes, and snippets.

@mbientlab
Created August 26, 2015 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbientlab/0f44d57dac2b4c28431c to your computer and use it in GitHub Desktop.
Save mbientlab/0f44d57dac2b4c28431c to your computer and use it in GitHub Desktop.
Copy of the code added to the home panel of the MetaWear Android app
view.findViewById(R.id.program_keychain).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switchModule.routeData().fromSensor().monitor(new DataSignal.ActivityHandler() {
@Override
public void onSignalActive(Map<String, DataProcessor> map, DataSignal.DataToken dataToken) {
ledModule.configureColorChannel(Led.ColorChannel.BLUE)
.setHighIntensity((byte) 31)
.setHighTime((short) 50)
.setPulseDuration((short) 500)
.setRepeatCount((byte) 3)
.commit();
ledModule.play(false);
}
}).commit();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment