Skip to content

Instantly share code, notes, and snippets.

@andreareginato
Created December 5, 2014 13:45
Show Gist options
  • Save andreareginato/a74b51631f13c42515c9 to your computer and use it in GitHub Desktop.
Save andreareginato/a74b51631f13c42515c9 to your computer and use it in GitHub Desktop.
public void RunLightMonitor() {
// Get onboard led reference
this._ledOnBoard = new OutputPort(Pins.ONBOARD_LED, false);
while (true) {
LelylanConnection();
// read onboard led status
bool ledStatus = this._ledOnBoard.Read();
// publis led status on server lelylan
if (readState != previousState) {
LelylanPublish(currentState ? "on" : "off");
}
previousState = readState;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment