Auto iterate through configuration inputs

Allows user to map all inputs seamlessly without having to
click on each button.

Also increased button timeout to 5 seconds from 1.5 due to pita.

Motion controls are not included since they will be special cases.
The button is always found so it will never be equal to end. Once iterated it can then be equal to end. Then the for loop will not be executed, changed code to make more clear.