We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,I'm trying to make a christmas program because it's that time of year, but my lights on my tree keep returning to the basic instead of staying at the color i want them. I want my lights to change every 10 seconds to a different color & even made a timer to say when, but after they change the color automatically jumps back to the first one. I want all the lights to switch colors at the same time, so I'm just using a single timer. Since the code thing keeps messing up my code I'll place it in a link.
here the main tab; https://paste.ofcode.org/3aBVmezJj4KAGWQEdfFbV8m
here the timer tab; https://paste.ofcode.org/WBdYEJWLBXpeDZf63YjWed
here the light tab: https://paste.ofcode.org/36ecFTCGTgu4zht7xPXg9RG
here the control tab it how I place the light: https://paste.ofcode.org/v4WnYR3tW8KdEJHbyxdUbB
Answers
you called con.update() in draw() which overwrites all the lights every time.
I put con.update() in setup() instead
also, I think c in the class Light should be int and not float
you forgot to post the Tree class.
Chrisir
How to post in the processing forum.
Best is to hit ctrl-t in processing first before copy paste into the forum (https://forum.processing.org).
You can edit your post (click the small gear and the 'Edit').
How to format Code:
the problem is the lights change but then switch back 1 second later.
I Fixed that above
Did you try my code? Run it
sry thought that was showing how to post I'll try it. TY it works. now I just need to add random lights ty for help.
you're welcome!