Assuming you have 20 groups, then you can use my previous screen shot to automatically set up the pattern, on startup, then you call PatternGen.Pattern whenever you need to turn the next group on. If you need to turn the others off first, just use a similar For loop to turn ALL off, then just the one you want on.