Am I doing something wrong in the sketch?
Maybe. Maybe not. It all depends on how your switch is actually wired. Which you haven't described.
Am I doing something wrong in the sketch?
Maybe. Maybe not. It all depends on how your switch is actually wired. Which you haven't described.