Dateien hochladen nach „config“
parent
58e8ca4110
commit
16daa2723a
|
@ -0,0 +1,38 @@
|
|||
const { Client } = require("openrgb-sdk")
|
||||
const flags = require("./config/flags.js")
|
||||
|
||||
|
||||
const ms = 1000;
|
||||
let client;
|
||||
|
||||
async function start () {
|
||||
client = new Client("Example", 6742, "localhost")
|
||||
|
||||
await client.connect()
|
||||
const amount = await client.getControllerCount()
|
||||
console.log(amount)
|
||||
let deviceList = []
|
||||
for (let deviceId = 0; deviceId < amount; deviceId++) {
|
||||
deviceList.push(await client.getControllerData(deviceId))
|
||||
}
|
||||
console.log(deviceList)
|
||||
loop()
|
||||
}
|
||||
|
||||
|
||||
async function loop(i=0){
|
||||
await client.updateLeds(0, flags[flags.animate[i]])
|
||||
await client.updateLeds(1, flags[flags.animate[i]])
|
||||
await client.updateLeds(2, flags[flags.animate[i]])
|
||||
await client.updateLeds(3, flags[flags.animate[i]])
|
||||
//await client.disconnect()
|
||||
i++;
|
||||
if(i>=flags.animate.length){
|
||||
i=0
|
||||
}
|
||||
setTimeout(_ => loop(i), ms)
|
||||
}
|
||||
console.log(flags[flags.animate[1]])
|
||||
start()
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "openrgb_control",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"openrgb-sdk": "^0.5.2"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue