I also was pushing for the potentiometer solution but it met with much resistance based upon the idea that it would be less precise.
In any case I have posted the code in .zip file here. I commented out some ideas I had and tried to run it as pure to your example.
https://onedrive.live.com/redir?resid=94CA3E1384343D7D!1159&authkey=!AM07Cq1 eGOhWI68&ithint=file%2czip
Here's some screen shots below of the HW Breakpoints
https://onedrive.live.com/redir?resi...nt=photo%2cPNG
https://onedrive.live.com/redir?resi...nt=photo%2cPNG
kmbworkemail@gmail.com