Better distance test

This commit is contained in:
Nathan Kunicki 2018-06-14 18:08:41 +01:00
parent cf3d17e1f5
commit b0400856cc

View File

@ -18,7 +18,7 @@ lpf2.on("discover", (hub) => {
moveHub.on("distance", (port, distance) => {
console.log(`Distance ${distance} received on port ${port}`);
if (distance < 100) {
if (distance < 90) {
moveHub.setMotorSpeed("D", 40);
} else {
moveHub.setMotorSpeed("D", 0);
@ -31,7 +31,7 @@ lpf2.on("discover", (hub) => {
wedoHub.on("distance", (port, distance) => {
console.log(`Distance ${distance} received on port ${port}`);
if (distance < 100) {
if (distance < 90) {
wedoHub.setMotorSpeed("B", 40);
} else {
wedoHub.setMotorSpeed("B", 0);