I am programming our LED’s for the robot this year and a mentor suggested using the new LED library for this year instead of an arduino. I looked at some example code that seamed to be working, but it was using HSV instead of RGB which is what I was used to. The line of code that set a specific pixel on our LED strip to a color was:
m_ledBuffer.setHSV(pixel, hue, saturation, value);
I found another line that used RGB instead of HSV:
m_ledBuffer.setRGB(pixel, red, green, blue);
Using this line, I created a simple ‘for’ loop that would set every pixel on our 60 pixel LED strip to (255, 0, 0,) meaning red:
for (var i = 0; i < 60; i++) {
m_ledBuffer.setRGB(i, 255, 0, 0);
}
This code turned on the whole LED strip, but each LED was a different color, still making the rainbow pattern of the original function. I set different LED’s to red, but each one was stuck on their original color. It seems I can only turn on specific LED’s but I can’t change their colors. Has anybody encountered this problem or know how to fix it? Thanks!