Created
October 5, 2012 15:37
-
-
Save line-o/3840567 to your computer and use it in GitHub Desktop.
Node AR Drone Warn on low Battery Status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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