Fully working version

Auto-Dim issue appears to be caused by voltage drop.   At very low power
there are no issues.  Adding addition power (via potentiometer or
photocell) causes the same issues.

Therefore, I assume the code is fine and that I need to create a 'star'
topology for my power connections.