Comparing analog signals

OK, it makes no sense to even think about the logic (which, at a glance, looks fine) until you have figured out the electrical or mechanical issues.

a7