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

LS100 brightness and other Problems #374

Open
skatehouse opened this issue May 13, 2024 · 2 comments
Open

LS100 brightness and other Problems #374

skatehouse opened this issue May 13, 2024 · 2 comments
Labels
Stale support User needs help

Comments

@skatehouse
Copy link

skatehouse commented May 13, 2024

Hello! I use the Arduino Micro with LS100. Admittedly, I had original LS100s before, but they were too dark for me.
I have the 2812b and cut it to 2x27 + 2x15. What doesn't explain to me is the following:

If I put 84 LEDs on the channel, since there are 84 LEDs, the LEDs remain dark and don't light up at all.
With 135 LEDs it's fine.
What I then notice, however, is that the colors are slightly offset when I play an Ambilight test video.

2nd problem is with the brightness. Since the brightness is limited to 50%, I tried to increase it to 100%. Here too, all LEDs remain dark.

This is the original one:

`

#include <CorsairLightingProtocol.h>
#include <FastLED.h>
// Hint: The channels of the LS100 are swapped in iCUE, so the first channel in iCUE is here channel 2
#define DATA_PIN_CHANNEL_1 2
#define DATA_PIN_CHANNEL_2 3
#define BUTTON_PIN 4
// Hint: The ATmega32U4 does not have enough memory for 135 leds on both channels
CRGB ledsChannel1[135];
CRGB ledsChannel2[54];
CorsairLightingFirmwareStorageEEPROM firmwareStorage;
CorsairLightingFirmware firmware(CORSAIR_SMART_LIGHTING_CONTROLLER, &firmwareStorage);
FastLEDControllerStorageEEPROM storage;
FastLEDController ledController(&storage);
CorsairLightingProtocolController cLP(&ledController, &firmware);
CorsairLightingProtocolHID cHID(&cLP);
void setup() {
	FastLED.addLeds<WS2812B, DATA_PIN_CHANNEL_1, GRB>(ledsChannel1, 135);
	FastLED.addLeds<WS2812B, DATA_PIN_CHANNEL_2, GRB>(ledsChannel2, 54);
	ledController.addLEDs(0, ledsChannel1, 135);
	ledController.addLEDs(1, ledsChannel2, 54);
	pinMode(BUTTON_PIN, INPUT_PULLUP);
}
void loop() {
	static bool lightingEnabled = true;
	cHID.update();
	if (buttonClicked()) {
		lightingEnabled = !lightingEnabled;
		fill_solid(ledsChannel1, 135, CRGB::Black);
		fill_solid(ledsChannel2, 54, CRGB::Black);
		FastLED.show();
	}
	if (lightingEnabled && ledController.updateLEDs()) {
		FastLED.show();
	}
}
/**
 * Handle button of the LS100. The button is optional.
 *
 * @return true if the button was pressed and then released.
 */
bool buttonClicked() {
	static bool previousState = 1;
	bool state = digitalRead(BUTTON_PIN);
	if (previousState == 0 && state == 1) {
		previousState = state;
		return true;
	}
	previousState = state;
	return false;
}

Here the adpted one:


/*
   Copyright 2019 Leon Kiefer

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

	   http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
#include <CorsairLightingProtocol.h>
#include <FastLED.h>

// Hint: The channels of the LS100 are swapped in iCUE, so the first channel in iCUE is here channel 2
#define DATA_PIN_CHANNEL_1 2
#define DATA_PIN_CHANNEL_2 3

#define BUTTON_PIN 4

// Hint: The ATmega32U4 does not have enough memory for 135 leds on both channels
CRGB ledsChannel1[84];
CRGB ledsChannel2[54];

CorsairLightingFirmwareStorageEEPROM firmwareStorage;
CorsairLightingFirmware firmware(CORSAIR_SMART_LIGHTING_CONTROLLER, &firmwareStorage);
FastLEDControllerStorageEEPROM storage;
FastLEDController ledController(&storage);
CorsairLightingProtocolController cLP(&ledController, &firmware);
CorsairLightingProtocolHID cHID(&cLP);

void setup() {
	FastLED.addLeds<WS2812B, DATA_PIN_CHANNEL_1, GRB>(ledsChannel1, 84);
	FastLED.addLeds<WS2812B, DATA_PIN_CHANNEL_2, GRB>(ledsChannel2, 54);
	ledController.addLEDs(0, ledsChannel1, 84);
	ledController.addLEDs(1, ledsChannel2, 54);

	// modify the RGB values before they are shown on the LED strip
	ledController.onUpdateHook(0, []() {
		// increase the brightness of channel 1 when using iCUE, because iCUE only set brightness to max 50%
		CLP::fixIcueBrightness(&ledController, 0);
	pinMode(BUTTON_PIN, INPUT_PULLUP);

  	});
}

void loop() {
	static bool lightingEnabled = true;
	cHID.update();

	if (buttonClicked()) {
		lightingEnabled = !lightingEnabled;
		fill_solid(ledsChannel1, 84, CRGB::Black);
		fill_solid(ledsChannel2, 54, CRGB::Black);
		FastLED.show();
	}

	if (lightingEnabled && ledController.updateLEDs()) {
		FastLED.show();
	}
}

/**
 * Handle button of the LS100. The button is optional.
 *
 * @return true if the button was pressed and then released.
 */
bool buttonClicked() {
	static bool previousState = 1;
	bool state = digitalRead(BUTTON_PIN);
	if (previousState == 0 && state == 1) {
		previousState = state;
		return true;
	}
	previousState = state;
	return false;
}
@skatehouse skatehouse added the support User needs help label May 13, 2024
@Legion2
Copy link
Owner

Legion2 commented May 20, 2024

Maybe you have issues with your power supply. If you try to light up too many LEDs they turn off because there is not enough power available

Copy link

github-actions bot commented Jun 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale support User needs help
Projects
None yet
Development

No branches or pull requests

2 participants