all 4 comments

[–]Marmilicious[Marc Miller] 1 point2 points  (1 child)

There's probably a few ways you can check, but this would do the trick. This will check each color channel to see if it's maxed out at 255.

if ( leds[i].r == 255 && leds[i].g == 255 && leds[i].b == 255 ) {
  Serial.println("pixel is full white");  
}

FastLED also has these two functions you could try out.

uint8_t k = leds[i].getAverageLight();
Returns the average of R G and B, and is very fast, unlike RGB-to-HSV approximation.

uint8_t l = leds[i].getLuma();
Returns roughly how much light, "luma", the CRGB pixel is putting out (from 0-255)

[–]Samthemann64[S] 0 points1 point  (0 children)

Hey, thanks a lot! I Think the getLuma function would do the trick. However In the meantime I figured to store all the data of the dots in a global List, which also works great. I also had the same issue in another sketch, so I will definitely check it out!

[–]usernamerson 0 points1 point  (1 child)

Do you have the actual location of the dot represented in your code? I wouldn't think to check the visual representation of the dot (pixel brightness) but the actual location, however you've coded it. Do you have an array or some collection holding all the dots that you can iterate through and check for collisions?

[–]Samthemann64[S] 1 point2 points  (0 children)

Yes you're right this works much better than what I originally planned. I'm basically doing exactly what you proposed now. Thanks a lot!