Skip to content

Instantly share code, notes, and snippets.

@amcjen
Created March 11, 2014 17:48
Show Gist options
  • Save amcjen/9491143 to your computer and use it in GitHub Desktop.
Save amcjen/9491143 to your computer and use it in GitHub Desktop.
# power
## power.ischarging
#### Description
`int power.ischarging()`
Determines if the Scout is charging its battery via USB. This will also mirror the orange charging LED next to the USB port, which also shines when charging, and turns off when either fully-charged, or the Scout is not plugged in.
```
> print power.ischarging
> 1
```
#### Parameters
None
#### Return Values
Returns `0` if the Scout is not charging, and `1` if it is charging.
#### Warning
The results of this command are undefined if you don't have a battery plugged into the Scout, and only powering it via USB. This is due to the Lipo battery charger constantly trying to charge the non-existent battery.
## power.percent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment