Photon and RGB LED sketch?


I want to combine a RGB LED with the Particle Photon, I want to change the color of the RGB LED while playing music (tempo).
I had to make a sketch but I don’t know if it’s right what I have made.
At the bottom there is my sketch. Can you tell me if I did it right and if I didn’t, what should I do instead?

Thank you!

Hey there and welcome to the community,

I think we’re missing a bit of info :wink:

As far as doing things right/wrong goes… Did it work? Then it’s right, if it didn’t, it probably isn’t right. Depends on what you want it to do for your situation :smile:

Also it depends on the RGB LED you use (common anode vs. common cathode)