Vernie test file

This commit is contained in:
Nathan Kunicki 2018-06-21 09:46:53 +01:00
parent feb00741c9
commit 11556bf292

25
vernie.js Normal file
View File

@ -0,0 +1,25 @@
const LPF2 = require(".");
const lpf2 = new LPF2.LPF2();
lpf2.scan();
lpf2.on("discover", (hub) => {
hub.connect(async () => {
console.log("Connected to Vernie!");
let color = 0;
setInterval(() => {
color = color > 10 ? 1 : color + 1;
hub.setLEDColor(color);
}, 2000);
await hub.setMotorSpeed("AB", 30, 2000);
await hub.setMotorAngle("B", 360, -30)
await hub.setMotorSpeed("A", 30, 2000);
await hub.setMotorSpeed("B", -30, 2000);
});
});