Look here:-
When the switch is open, a high is felt on the MCU pin
When the switch is on then the port pin will be low.
So!!! I read the port.... If the port is low then I set the variable "switch1" on!!
When the switch is open, a high is felt on the MCU pin
When the switch is on then the port pin will be low.
So!!! I read the port.... If the port is low then I set the variable "switch1" on!!