pxt-ev3/libs/core/battery.ts
Galen Nickel 822227eb48 Brick ref topics 02 (#283)
* Add brick button topics

* Add the rest of the brick api
2018-01-30 20:58:18 -08:00

13 lines
323 B
TypeScript

namespace brick {
/**
* Returns the current battery level
*/
//% blockId=brickBatteryLevel block="battery level"
//% group="More"
//% help=brick/battery-level
export function batteryLevel(): number {
const info = sensors.internal.getBatteryInfo();
return info.current;
}
}