Issues with connecting a slideswitch to change between automatic and manual mode for a fan

Your code is not reading the switch input.