basic reading of battery level (#182)

This commit is contained in:
Peli de Halleux
2018-01-04 21:50:13 -08:00
committed by GitHub
parent 0db6987ee5
commit 1e460eef9e
6 changed files with 26 additions and 1 deletions

View File

@ -89,6 +89,14 @@ namespace sensors.internal {
//serial.writeLine("UART " + port + " / " + mode + " - " + info)
}
export function getBatteryInfo(): { temp: number; current: number } {
init();
return {
temp: analogMM.getNumber(NumberFormat.Int16LE, AnalogOff.BatteryTemp),
current: analogMM.getNumber(NumberFormat.Int16LE, AnalogOff.BatteryCurrent)
}
}
function detectDevices() {
let conns = analogMM.slice(AnalogOff.InConn, DAL.NUM_INPUTS)
let numChanged = 0