diff --git a/rust_native_module/test.js b/rust_native_module/test.js index 55f870c..8c883ce 100644 --- a/rust_native_module/test.js +++ b/rust_native_module/test.js @@ -1,2 +1,60 @@ const mod = require('.') -console.log(mod.hello()) + +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();