Skip to content

Instantly share code, notes, and snippets.

@line-o
Created October 5, 2012 15:37
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 line-o/3840567 to your computer and use it in GitHub Desktop.
Save line-o/3840567 to your computer and use it in GitHub Desktop.
Node AR Drone Warn on low Battery Status
/**
* Warn on console and turn all LEDs red if battery is not charged enough to take off
* usage:
* ```client.on('navdata', warnOnLowBat);```
*/
var warnOnLowBat = function (nav){
if (nav.droneState.lowBattery === 1) {
this.animateLeds('red', 1, 1);
console.warn('New battery please!');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment