822227eb48
* Add brick button topics * Add the rest of the brick api
13 lines
323 B
TypeScript
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;
|
|
}
|
|
} |