Hi there,
Could please someone help me with RGBSet Reference,
I had to switch to RGBSet, to easily address parts of the LED strip.
Now I just do not know how to adjust the data handling of the Ambilight code.
Prior to RGBSet it was done like this:
//initialization part
CRGB leds[NUM_LEDS];
uint8_t * ledsRaw = (uint8_t *)leds;
//data part
ledsRaw[outPos++] = buffer[indexOut++];
With RGBSet, I initialize my CRGB array:
CRGBArray<NUM_LEDS> leds;
Initialization ledsRaw does not work:
uint8_t * ledsRaw = (uint8_t *)leds;
I get following error: invalid cast from type ‘CRGBArray<296>’ to type ‘uint8_t* {aka unsigned char*}’
How do I have to adjust the initialization of ledsRaw to work with RGBSet?
Thank you for your help.
Best wishes,
Christian
@Christian_Barth please use pastebin and repost
Sorry, here is the pastebin link for readable source code
http://pastebin.com/3A2vWx5R
regardless of your problem - are you seriously powering Ground for your LEDs via Pin 10 ?
#define GROUND_PIN 10
#define MAX_CURRENT 10000
Holy smokes - you will burn it out.
and a hint for your problem: you are missing in your CRGBSet the *
@Juergen_Bruegl
Hi Juergen,
Thanks for the quick reply.
I do not power the LEDs through the ground pin. This is just the pin I use to connect the teensy to the ground of my 5V power supply. Like this, I have the same ground reference for the data signals.
As far as I understood it, this is the way to go. The max. current I defined in the source code is only to protect the power supply in case all the LEDs are white and are thus drawing the maximum.
Could you please explain how in your example I can reverse the direction of the LED numbering in on of the LED arrays?
I don’t get how to do this there.
Best wishes,
Christian
Tell me when you want LED lights. Mericana sales9@uniqueentech.com