项目作者: DanielRamosAcosta

项目描述 :
ASUS's Aura Sync Node.js bindings
高级语言: C++
项目地址: git://github.com/DanielRamosAcosta/aura-sdk.git
创建时间: 2018-04-30T22:04:40Z
项目社区:https://github.com/DanielRamosAcosta/aura-sdk

开源协议:MIT License

下载


aura-sdk

NPM Version

DEPRECATION NOTICE: I no longer own a PC with Aura RGB components, so I can no longer maintain this library (I don’t have any hardware to test it). Feel free to fork the repository if you wish.

ASUS Aura’s SDK Nodejs C++ bindings. This package provides an high-level API
to manage your rig led show!

WARNING: Because Asus is only releasing their DLL for the 32bits arch, it only works and Node 32 bits.

RGB Stepper Demo

Usage

  1. npm install --save aura-sdk

You have to create an instance of the SDK, and then create an instanace for each
device. This examples creates an RGB stepper

  1. const { sleep } = require('./sleep')
  2. const { AuraSDK, Controller } = require('..')
  3. async function main() {
  4. const auraSDK = new AuraSDK()
  5. const leds = Controller.joinControllers([
  6. auraSDK.createMbController(),
  7. auraSDK.createGPUController(),
  8. auraSDK.createDramController()
  9. ])
  10. while (true) {
  11. for (color of ['red', 'green', 'blue']) {
  12. for (let led of leds) {
  13. led.setColorNow(color)
  14. await sleep(1000)
  15. }
  16. }
  17. }
  18. }
  19. main()
  20. .catch(err => console.error(err))

API

AuraSDK

This is the main SDK entrypoint. It creates instances for the different devices types.

  • AuraSDK#createMbController(): Creates an instance of the motherboard controller
  • AuraSDK#createGPUController(): Creates an instance of the GPU controller
  • AuraSDK#createDramController(): Creates an instance of the DRAM controller

Controller

  • Controller.joinControllers(controllers: Controller[]): Joins multiple controllers into one array of callable functions. See the the example for usage.
  • Controller#getLedCount(): Get number of controllable leds in this controller.
  • Controller#getDeviceName(): Get the device name (motherboard, GPU, DRAM).
  • Controller#setColor(index: number, color: string): Set the color of the LED at the given index.
  • Controller#setAllColor(color: string): Sets the color of all the leds in the controller.
  • Controller#setColorNow(index: number, color: string): Sets the color of the LED at the given index and immediately updates them.
  • Controller#setAllColorNow(color: string): Sets the color of all the leds in the controller and immediately updates them.
  • Controller#updateColor(): Updates the LEDs attached to the controller to reflect the current state.