Duggle Posted October 24, 2019 Report Share Posted October 24, 2019 I'm away from my usual development computer so I've set up all the tools on my laptop and compiled an app that I'm developing. In this new context I'm finding that the blue colour component is showing on the previous LED in the chain. extern "C" void APP_Init(void){ // mled.test(); // Initialise all LEDs MIOS32_BOARD_LED_Init(0xffffffff); WS2812_Init(0); WS2812_LED_SetRGB(10,0,100); WS2812_LED_SetRGB(10,1,000); WS2812_LED_SetRGB(10,2,100); So here we see LED #9 is blue and LED #10 is red. This also happens with WS2812_LED_SetHSV(..). I'm left with the fact that it seems to be a problem in the driver that wasn't in my other setup which I don't have access to ATM. Any help appreciated! Quote Link to comment Share on other sites More sharing options...
Duggle Posted October 27, 2019 Author Report Share Posted October 27, 2019 Like I said the previous index of blue led is addressed. I'm not saying there's a bug in the repo, because I used it fine in the recent past. The problem affects both WS2812_LED_SetRGB(led,2,val), and WS2812_LED_GetRGB(led,2,val) i.e getting and setting the Blue led. To make things work right I have made the following changes to ws2812.c (to get me out of trouble...) if( colour == 0 ) colour_ix = 2; else if( colour == 1 ) colour_ix = 0; else if( colour == 2 ){ colour_ix = 1; led++; } else return -2; // unsupported colour i.e increment led for the blue (and only blue) LED. in both the Get and Set function. This is obviously a problem of my own making but I can't see what i could have done to cause it! :-) Quote Link to comment Share on other sites More sharing options...
TK. Posted January 12, 2020 Report Share Posted January 12, 2020 Found the bug - fixed! :) Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.