partylights/rust_native_module/test.js

61 lines
999 B
JavaScript

const mod = require('.')
const o = mod.openOutput("/dev/ttyUSB0")
if (o.type !== "success") {
return
}
const movingHeads = [
{
startAddress: 1,
pan: 0,
tilt: 0,
brightness: {
type: "dimmer",
value: 1,
},
rgbw: [255, 0, 0, 0],
speed: 0,
},
{
startAddress: 15,
pan: 0,
tilt: 0,
brightness: {
type: "dimmer",
value: 1,
},
rgbw: [255, 0, 0, 0],
speed: 0,
},
{
startAddress: 29,
pan: 0,
tilt: 0,
brightness: {
type: "dimmer",
value: 1,
},
rgbw: [255, 0, 0, 0],
speed: 0,
},
{
startAddress: 43,
pan: 0,
tilt: 0,
brightness: {
type: "dimmer",
value: 1,
},
rgbw: [0, 0, 0, 255],
speed: 0,
}
];
r = o.set(movingHeads);
console.log(r);
o.close();