Nathan Kunicki 0e00bfd653 Testing
2018-07-31 11:12:10 +01:00

18 lines
402 B
JavaScript

const LPF2 = require("..").LPF2;
const lpf2 = new LPF2();
lpf2.scan(); // Start scanning for hubs
console.log("Looking for Hubs...");
lpf2.on("discover", async (hub) => { // Wait to discover hubs
await hub.connect(); // Connect to hub
console.log("Connected to Hub!");
setTimeout(() => {
hub.setMotorSpeed("A", 50, 500);
//hub.setMotorSpeed("B", 50);
}, 3000);
});