Changed the logic algorithm to a more sensible setup.
Created a setup function in the controller, as this is standard, not per case different.
Merged the relevant changes from the TimedSwitching Branch.
Added a calibration option and updated the setup algorithm to use this calibration option.
Fixed small errors preventing it from compiling
Added a step function and changed the calibration and startup algorithms a bit.
Rewrote the logic function to also take care of small intervals for the
last state before rolling over to 0.
Added a test case for the switching algorithm.
The switching algorithm works, so the test is succesfull.