@ajb2k3 That all makes sense to me.

Sorry for the confusion, I'm trying to use either the mechanical limit switch OR the ir photogate as a limit switch. Not trying to use both at the same time. But I was unable to use either module using the corresponding UIFlow module integration. I'll post an example next week which hasn't worked for me so far.

Yea, I originally had it in port A but moved it over after confirming there wasn't a negative impact as it's a bit cleaner with both plugs on the same side of the device. If you said there was an electrical difference that could be causing the non-zero reset bug I could try port A again. Any ideas there? Should I be using a different reset / get function? How can I debug this issue better?

Seems pretty clear cut when I'm setting the rotary_value to 0 but when I get the rotary value, it's not 0. It resets to the initial value, which is often not 0. Today I recall three reboots which all had different reset values, roughly 636, -1035, -1.

-1 was close enough and worked for me, but when I got the other values I just reset the board and basically got it to choose a new "0" value.