All Projects → Legion2 → Corsairlightingprotocol

Legion2 / Corsairlightingprotocol

Licence: apache-2.0
Control LEDs connected to an Arduino with iCUE, create an unofficial Corsair iCUE compatible Arduino LED controller.

Projects that are alternatives of or similar to Corsairlightingprotocol

Acebutton
An adjustable, compact, event-driven button library for Arduino that debounces and dispatches events to a user-defined event handler.
Stars: ✭ 180 (-1.1%)
Mutual labels:  arduino, arduino-library
M5stack Sd Updater
💾 Customizable menu system for M5Stack and ESP32-Chimera-Core - loads apps from the Micro SD card. Easily add you own apps
Stars: ✭ 175 (-3.85%)
Mutual labels:  arduino, arduino-library
Liquidmenu
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
Stars: ✭ 141 (-22.53%)
Mutual labels:  arduino, arduino-library
Packetserial
An Arduino Library that facilitates packet-based serial communication using COBS or SLIP encoding.
Stars: ✭ 177 (-2.75%)
Mutual labels:  arduino, arduino-library
Espmqttclient
Wifi and MQTT handling for ESP8266 and ESP32
Stars: ✭ 169 (-7.14%)
Mutual labels:  arduino, arduino-library
Tmc2130stepper
Arduino library for Trinamic TMC2130 Stepper driver
Stars: ✭ 141 (-22.53%)
Mutual labels:  arduino, arduino-library
Arduino Fsm
Arduino library for implementing a finite state machine.
Stars: ✭ 142 (-21.98%)
Mutual labels:  arduino, arduino-library
Arduino Timer
Non-blocking library for delaying function calls
Stars: ✭ 133 (-26.92%)
Mutual labels:  arduino, arduino-library
Pzem004t
Arduino communication library for Peacefair PZEM-004T Energy monitor
Stars: ✭ 165 (-9.34%)
Mutual labels:  arduino, arduino-library
Arduino Menusystem
Arduino library for implementing a menu system
Stars: ✭ 161 (-11.54%)
Mutual labels:  arduino, arduino-library
Rf24
OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices
Stars: ✭ 1,813 (+896.15%)
Mutual labels:  arduino, arduino-library
Bh1750
An Arduino library for the digital light sensor breakout boards containing the BH1750FVI IC
Stars: ✭ 173 (-4.95%)
Mutual labels:  arduino, arduino-library
Irremoteesp8266
Infrared remote library for ESP8266/ESP32: send and receive infrared signals with multiple protocols. Based on: https://github.com/shirriff/Arduino-IRremote/
Stars: ✭ 1,964 (+979.12%)
Mutual labels:  arduino, arduino-library
Socket.io Client
A socket.io-client implementation for ESP8266 and Arduino
Stars: ✭ 170 (-6.59%)
Mutual labels:  arduino, arduino-library
Rotaryencoder
RotaryEncoder Arduino Library
Stars: ✭ 134 (-26.37%)
Mutual labels:  arduino, arduino-library
Si5351arduino
Library for the Si5351 clock generator IC in the Arduino environment
Stars: ✭ 141 (-22.53%)
Mutual labels:  arduino, arduino-library
Loralib
Arduino library for LoRa modules based on SX127x/RFM9x chips
Stars: ✭ 134 (-26.37%)
Mutual labels:  arduino, arduino-library
Tinyspi
Arduino hardware SPI library for ATtiny44/84, 45/85, 461/861, 2313/4313.
Stars: ✭ 134 (-26.37%)
Mutual labels:  arduino, arduino-library
Arduino Device Lib
Arduino Library for TTN Devices
Stars: ✭ 155 (-14.84%)
Mutual labels:  arduino, arduino-library
Arduino Applemidi Library
Send and receive MIDI messages over Ethernet (rtpMIDI or AppleMIDI)
Stars: ✭ 177 (-2.75%)
Mutual labels:  arduino, arduino-library

Corsair Lighting Protocol arduino-library-badge Test Status Average time to resolve an issue

iCUE RGBSync OpenRGB

This library can be used to integrate custom/unofficial RGB strips with iCUE. This is not an official corsair project.

Features

  • Add support of Corsair DIY device protocol to Arduino.
  • Control LEDs with the Corsair iCUE software.
  • Support common LED chipsets. (e.g. WS2812B, WS2801)
  • Support FastLED.
  • Supported platform: Arduino AVR
  • Hardware Lighting mode.
  • Use multiple devices at the same time.
  • Repeat or scale LED channels to arbitrary size.

Supported Devices

  • Lighting Node PRO
  • Commander PRO
  • Lighting Node CORE
  • LS100 Smart Lighting Controller
  • LT100 Smart Lighting Towers

Overview

Getting started

This project is an Arduino library called "Corsair Lighting Protocol". It can be used to control Arduino boards with iCUE. This project provides example sketches for easy use with Arduino IDE.

Requirements

The library is compatible with all boards using the MCU ATmega32U4. This includes Arduino Leonardo, SparkFun Pro Micro, Arduino Micro, and Adafruit 32u4 AVR Boards. It also supports the Arduino Uno and Arduino Mega, but this requires the HoodLoader2 bootloader, see this wiki for more details. It is not compatible with ATmega328 (Arduino Nano), STM8S103F3, teensy, ESP8266 and ESP32 see list of architecture/platform for a detailed description why they are not supported. In the rest of the documentation "Arduino" is used as a synonym for all supported boards regardless of the manufacturer.

When you have problems with a board not listed here, please open an Issue.

Install the libraries

To use this library you must install it with the Library-Manager. Open the Library-Manager in Arduino IDE via Tools->Manage Libraries... Search for "Corsair Lighting Protocol" and install the Corsair Lighting Protocol library. This library also requires the FastLED library. Search for "FastLED" in the Library-Manager and install the FastLED library.

Create a Lighting Node PRO

This guide will teach you how to create a Lighting Node PRO with an Arduino Leonardo compatible board. If you have an Arduino Uno or Mega, see the other guide.

  1. Open the example "LightingNodePRO", you can find it in Arduino IDE in the File menu->Examples->Corsair Lighting Protocol->LightingNodePRO. If you can't open the LightingNodePRO example the Corsair Lighting Protocol library is not installed correctly.

    open example sketch

  2. Install the CLP Boards. They can be installed by following the CLP Boards installation guide. After installation it should be possible to select the CLP Boards in the Arduino IDE as shown in the screenshot below. If your are using a Sparkfun Pro Micro also install the SparkFun Boards definition.

    select CLP Board

  3. Upload the "LightingNodePRO" sketch to your Arduino.

    upload sketch

  4. Do the wiring. For more information on how to wire the leds and how to set up the LEDs in the code see the links.

    the wiring

  5. Verify your device works as expected. Open the Windows settings->devices->Other devices. Somewhere in the list of devices, there should be a device called "Lighting Node PRO".

  6. Now open iCUE there you should see the "Lighting Node PRO".

Use the Lighting Node PRO

iCUE RGB Strip example

In iCUE open the "Lighting Setup" tab of the Lighting Node PRO(LNP) and set for both Lighting Channels the device to "RGB Light Strip" and the amount to a tenth of the LEDs you have. iCUE groups the LEDs into groups of ten. So if you have 20 LEDs, set the amount to 2. Now you can create lighting effects in the "Lighting Channel #" tabs.

Documentation

How it works

This library uses the USB HID interface of the ATmega32U4. After uploading a sketch with the library and selected CLP Boards, iCUE recognizes the Arduino as a Corsair device, because the CLP Boards use USB IDs of Corsair. In iCUE you can then select the device and set some lighting effects. iCUE sends these via the HID protocol to the Arduino. These commands are understood by the library and converted into lighting effects on the RGB strips connected to the Arduino. The FastLED library is used to control the LEDs.

Use of multiple devices

Each device has two unique IDs, that is, they should be unique. You must give each device a unique ID. There are two IDs that must be changed Serial Number and DeviceID.

The Serial Number can be set in the constructor of CorsairLightingProtocolHID and CLPUSBSerialBridge as shown in the example.

const char mySerialNumber[] PROGMEM = "202B6949A967";
CorsairLightingProtocolHID cHID(&cLP, mySerialNumber);

The Serial Number MAY only consist of HEX characters (0-9 and A-F).

The DeviceID can be set with the setDeviceID function of CorsairLightingFirmware.

void setup() {
    byte deviceId[4] = { 0x9A, 0xDA, 0xA7, 0x8E };
    firmware.setDeviceID(deviceId);
    ...
}

Alternative

The DeviceID can be changed with the DeviceIDTool. Upload the DeviceIDTool sketch and then open the Serial monitor with baudrate 115200. The tool displays the current DeviceID, you can type in a new DeviceID that is saved on the Arduino. After that, you can upload another sketch.

Repeat or scale LED channels

You can repeat or scale LED channel controlled by iCUE onto physical LED strips. This is very useful if you have very long LED strips that are longer than 60/96/135 LEDs, which is the maximum number iCUE supports.

To repeat or scale a LED channel you must apply the CLP::repeat or the CLP:scale function in the update hook of the FastLEDController. See the RepeatAndScale example for the complete code. Both functions take the FastLEDController pointer and the channel index as arguments. Additionally, the repeat function takes as an argument how often the LED channel should be repeated. For example, if you want to duplicate the channel you must pass 2 as argument. The scale function takes as third argument the length of the physical LED strip to which it scales the channel using integer scaling. For example you have 144 physical LEDs on you strip and 60 on the LED channel. Then the third argument of the scale function is 144.

For both functions it's important, that the CRGB arrays have at least the length of the physical LED strip. This means if your LED channel from iCUE has 50 LEDs and you use the repeat function to control 100 physical LEDs you MUST declare the CRGB array at least with a length of 100.

Increase the Brightness of the LEDs

When using LS100 or LT100 iCUE only uses 50% of the LEDs brightness even if you set the brightness to max in the iCUE Device Settings. But there are good news, we can increase the brightness with the Arduino so we can use the full brightness of our LEDs. Add the CLP::fixIcueBrightness function to the onUpdateHook in the setup function as shown in the example. If there are multiple functions called in onUpdateHook, fixIcueBrightness should be the first. Only use this function with LS100 and LT100 devices!

ledController.onUpdateHook(0, []() {
	CLP::fixIcueBrightness(&ledController, 0);
});

Reverse direction of LED Strip

If you want to change the direction of the LEDs of the Strip without physically change the strip, the CLP::reverse function can be used. The reverse function must be called be for scaling.

ledController.onUpdateHook(0, []() {
	CLP::reverse(&ledController, 0);
});

Hardware Lighting mode

The Hardware Lighting mode can be configured in iCUE. It allows you the set lighting effects that will be active when iCUE is not running. This is the case when the PC is off, in sleep mode, booting or the user is logged out. So if you want to have lighing effects in all these situations, use the Hardware Lighting mode. If you don't want it, configure a static black color.

License

This project is licensed under the Apache 2.0 License.

DISCLAIMERS

This is a DO IT YOURSELF project, use at your own risk!

Credits

Related projects

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].