Millis Troubleshooting

ok i am having switching over my project from delay to Millis.

it worked (if jerkily with the delay but i want a faster response time)

2 sets of 4 leds performing basic patterns and such, the patterns that show depend on which of the switches are thrown (currently 10 patterns programmed in, although up to 16 possible with the set of switches i have).

http://ge.tt/8iSe1KH ^^^^ that is the 2 sets of code (pre and post millis attempts) - there may be a few minor changes in variables and pin out between them as the wiring side changed

i tried to set it up so the millis setup was it's own function which you called in the amount of time it waited. the function would input that amount do it's thing. it may just be wishful thinking that it would work that way. the way i have it i have a feeling it still would work as a delay (if the errors were removed)

The change from delay() to millis() is not just a replacement of the delay() function call with a call that waits till millis() reached some value. The intention of using millis() over delay() is to eliminate a waiting loop but running through the main loop constantly and acting if some time value is reached. Changing code that uses delay() to one that uses this new paradigm involves a restructuring of the whole main loop at least and usually follows the technique of a state machine (http://en.wikipedia.org/wiki/Finite-state_machine).

For your keypad input read all inputs at once, store the state into a bit field (for 4 buttons the lower nibble of a byte is enough to store the information). Then you can use a switch statement or even better a function pointer array to access your worker routines.