Thanks. I see the problem. You're not using the ws2812 code that was in the #114 zip file. You're using the code that Parallax posted on their WS2812 product page. That code has a different API from the code that I posted. You'll have to read their documentation to understand how to use this API and modify the code that I posted in #114 accordingly. In this case, it looks like they added additional parameters to the ws2812_init function. I think what they did is remove the code I had for supporting multiple strings of LEDs per COG and replaced it with code that only handles one string at a time.
Thanks. I was actually just thinking of using JM's driver but I need to modify it to use only Green and Blue. The code in his ws2812 demo would be the perfect pattern. I have tried modifying it but it is not working..
Hope to have all my stuff in C in time for Mini Maker Faire Ann Arbor this Saturday so I don't have to do so much shuffling. These events get pretty busy.
Not sure what you're expecting here. ws2812_wheel_dim() is a passive function, i.e. it just returns an RGB colour value. Said value goes into the colour array (your job) which is then passed to ws2812_set().
Yep, that's what I'm trying and it won't change the brightness. So I don't know if there are other commands in other libraries like _setx or something where brightness will work.
So there are some possibilities. A) I'm doing it wrong _wheel_dim isn't doing brightness correct C) _set can't set brightness D) ?
ws2812_set(driver, LED_PIN, ws2812_wheel_dim(pos,dim), LED_COUNT); //This is what I'm doing with pos and dim as integers between 0 and 255.
I vote A. ws2812_set() expects a colour array as the 3rd argument but you're passing a colour value instead. If you look at ws2812_Demo.c's alternate() function, inside the loop you see the colour array being initialised. This is where you'd apply your dim function, e.g.
ledColors[0] = ws2812_wheel_dim(pos,dim);
...
And I just realised that you posted the call in a previous post. Apologies for not picking up on it earlier.
Comments
ws2812_set(driver, LED_PIN, ws2812_wheel_dim(pos,dim), LED_COUNT);
Hope to have all my stuff in C in time for Mini Maker Faire Ann Arbor this Saturday so I don't have to do so much shuffling. These events get pretty busy.
Thanks!
Not sure what you're expecting here. ws2812_wheel_dim() is a passive function, i.e. it just returns an RGB colour value. Said value goes into the colour array (your job) which is then passed to ws2812_set().
So there are some possibilities. A) I'm doing it wrong _wheel_dim isn't doing brightness correct C) _set can't set brightness D) ?
ws2812_set(driver, LED_PIN, ws2812_wheel_dim(pos,dim), LED_COUNT); //This is what I'm doing with pos and dim as integers between 0 and 255.