Merge branch 'master' of github.com:nathankellenicki/node-poweredup
This commit is contained in:
commit
e6c575a0da
@ -131,10 +131,10 @@ export class ColorDistanceSensor extends Device {
|
|||||||
const partial = message[7];
|
const partial = message[7];
|
||||||
|
|
||||||
if (partial > 0) {
|
if (partial > 0) {
|
||||||
distance += 1.0 / partial;
|
distance = 1.0 / partial;
|
||||||
}
|
}
|
||||||
|
|
||||||
distance = Math.floor(distance * 25.4) - 20;
|
distance = Math.floor(distance * 25.4);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A combined color and distance event, emits when the sensor is activated.
|
* A combined color and distance event, emits when the sensor is activated.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user