We’re hosting a Christmas Party for some deaf friends on Boxing Day, so we thought it would be fun to play a few games, such as pass the parcel… except the key ingredient of “stop passing when the music stops” is kind of out of the window in their case. Instead, I thought I’d create a rainbow light display using an arduino with a strip of AndyPi WS2801 pixel lights, that flashes for a random amount of time between 5 and 45 seconds, and then turns off. A pushbutton can reset the system. The crucial ingredient, which was well worth learning was the millis() function, which counts the number of milliseconds since the arduino was turned on, and the random() and randomseed() functions. The lights are set to a rainbow swirl for as long as the time elapsed is less than the random number generated! I quickly threw it into a takeaway box with a hole for the pushbutton at the top. Code here:

AndyPi_PassTheParcel.ino