Code Problems - need some advice

long PATTERN_DELAY_MS = 0.5;

Storing a non-integer in an integer is rarely a good idea.