fix battery encoding
This commit is contained in:
parent
893dd0f9c4
commit
9d5ca35e83
@ -93,7 +93,7 @@ namespace sensors.internal {
|
|||||||
init();
|
init();
|
||||||
return {
|
return {
|
||||||
temp: analogMM.getNumber(NumberFormat.Int16LE, AnalogOff.BatteryTemp),
|
temp: analogMM.getNumber(NumberFormat.Int16LE, AnalogOff.BatteryTemp),
|
||||||
current: analogMM.getNumber(NumberFormat.Int16LE, AnalogOff.BatteryCurrent)
|
current: Math.round(analogMM.getNumber(NumberFormat.Int16LE, AnalogOff.BatteryCurrent) / 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ namespace pxsim {
|
|||||||
data,
|
data,
|
||||||
beforeMemRead: () => {
|
beforeMemRead: () => {
|
||||||
//console.log("analog before read");
|
//console.log("analog before read");
|
||||||
data[AnalogOff.BatteryTemp] = 21; // TODO simulate this
|
util.map16Bit(data, AnalogOff.BatteryTemp, 21);
|
||||||
data[AnalogOff.BatteryCurrent] = 100; // TODO simulate this
|
util.map16Bit(data, AnalogOff.BatteryCurrent, 900);
|
||||||
const inputNodes = ev3board().getInputNodes();
|
const inputNodes = ev3board().getInputNodes();
|
||||||
for (let port = 0; port < DAL.NUM_INPUTS; port++) {
|
for (let port = 0; port < DAL.NUM_INPUTS; port++) {
|
||||||
const node = inputNodes[port];
|
const node = inputNodes[port];
|
||||||
|
Loading…
Reference in New Issue
Block a user