Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate several leds in the base #163

Closed
benoit0727 opened this issue Aug 1, 2020 · 9 comments · Fixed by #165
Closed

Integrate several leds in the base #163

benoit0727 opened this issue Aug 1, 2020 · 9 comments · Fixed by #165
Assignees
Labels
bug Something isn't working support User needs help

Comments

@benoit0727
Copy link

Describe the problem
Hello, sorry for my translated English, I am French, my question is simple, is it possible to design several LEDs for the base, because I made the model of the towers available on thingiverse, unfortunately the led in the base does not light up enough, if you have any idea how to fix this eg have the first four leds work at the same time, otherwise everything works great! Thank you

System (please complete the following information):

  • OS: Windows 10
  • Board: Arduino Micro Pro
  • IDE: Arduino IDO
  • Version: 1.8.13
  • Sketch: LT100
@benoit0727 benoit0727 added the support User needs help label Aug 1, 2020
@Legion2
Copy link
Owner

Legion2 commented Aug 1, 2020

How many leds are in the base? In iCUE they are represented as a single LED. So you would have to use the first LED value from iCUE to control all the physical LEDs of the base. The Scale separate segments of a channel wiki explains how to scale segments. You would use it to define two segments for each tower (base and strip). The base is only one led in iCUE and is scaled to the number of leds in the physical base. The strip of the LT100 is not scaled.

@benoit0727
Copy link
Author

Hi, i tested with the piece of code you sent me, but i don't get a good result, the first led on icue turns me on two physical leds, the second led icue turns me on three physical leds, and after it turns on one by one correctly, I may have made a mistake in the code. Here is the piece of code :

void setup() {
FastLED.addLeds<WS2812B, DATA_PIN_CHANNEL_1, GRB>(ledsChannel1, 108);
ledController.addLEDs(0, ledsChannel1, 108);
ledController.onUpdateHook(0, {
CLP::SegmentScaling segments[8] = {{1, 4}, {26, 26}, {1, 4}, {26, 26},{1, 4}, {26, 26}, {1, 4}, {26, 26}};
CLP::scaleSegments(&ledController, 0, segments, 4);
});
}

@Legion2
Copy link
Owner

Legion2 commented Aug 5, 2020

Which version of this library (CorsairLightingProtocol) are you using?

@benoit0727
Copy link
Author

0.14.0

@Legion2
Copy link
Owner

Legion2 commented Aug 5, 2020

@benoit0727 The code looks good, only in the last line there it should be 8 instead of 4 CLP::scaleSegments(&ledController, 0, segments, 8);. I can reproduce your results and need to have a look at the code. I think there is a bug. I'll write you here when I know more.

@Legion2 Legion2 self-assigned this Aug 5, 2020
@Legion2 Legion2 added the bug Something isn't working label Aug 5, 2020
@benoit0727
Copy link
Author

benoit0727 commented Aug 5, 2020

ok no problem, thank you very much, i will give you the modified code

#include <FastLED.h>

#define DATA_PIN_CHANNEL_1 2

CRGB ledsChannel1[120];

CorsairLightingFirmware firmware = corsairLT100Firmware();
FastLEDController ledController(true);
CorsairLightingProtocolController cLP(&ledController, &firmware);
CorsairLightingProtocolHID cHID(&cLP);

void setup() {
	FastLED.addLeds<WS2812B, DATA_PIN_CHANNEL_1, GRB>(ledsChannel1, 120);
	ledController.addLEDs(0, ledsChannel1, 120);
  ledController.onUpdateHook(0, []() {
  CLP::SegmentScaling segments[8] = {{1, 4}, {26, 26}, {1, 4}, {26, 26},{1, 4}, {26, 26}, {1, 4}, {26, 26}};
  CLP::scaleSegments(&ledController, 0, segments, 8);
});
}

void loop() {
	cHID.update();

	if (ledController.updateLEDs()) {
		FastLED.show();
	}
} ```

@Legion2
Copy link
Owner

Legion2 commented Aug 5, 2020

@benoit0727 for multiline code you can use three ``` and a line break at the beginning and the end:
https://docs.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks

@Legion2
Copy link
Owner

Legion2 commented Aug 5, 2020

@benoit0727 The problem should now be fixed, you just need to update the library to the latest version.

@benoit0727
Copy link
Author

Yeah it works ! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working support User needs help
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants