I gathered that was what you were trying to do however the LEDs don't do random. They are either on or off (as is the port) so to create random light you would need to get a random value, decide on some criteria if it is 0 or 1 (aka LOW and HIGH although 0 and 1 will work as well) to write to the port. So in your loop you should call random (to get a new random value) decide if it is closer to 0 or 1 and then write the 0 or 1 to one of the led colors. Now do the same thing twice more but instead write the 0 or 1 to the next color of led. Once you have set all three to a random value then sleep for a while and repeat. To get more range than this you would need to arrange to use the pwm ports on the Arduino to set random intensitys but that is a fair bit more complex that this.
↧