Combining Codes

Ash - I am sure that your code works but I still prefer to use functions for the reasons that I gave even if a function is only called once. The problem is not writing the code but maintaining and changing it, particularly if that is not being done by the original author. That particularly relates to function names.

Seeing a function called RGB would indicate to me that it does something with the RGB LEDs whereas the in-line code says nothing about what is going on and it can be difficult to see where in the code a set of actions is complete. I should probably have called the function RGBsequence for even better readability. You can use comments to help understand what is going on but by using a function it can easily be tested on its own unlike the in-line code. Once you have a function that works it can be treated as a black box. That is, of course, how the intrinsic Arduino functions work.

There is a school of thought that says that each function, including loop(), should be no longer than one screen long in order to aid readability but that may be going too far !