Thermostat with 3 position switch

Hi there,

I am working a thermostat project. I have a basic thermostat sketch running but now I want to have 3 preset temperatures (HIGH MEDIUM & LOW) that can be chosen by a 3 position switch so only one temp can be selected at once. I have searched but have not come across any posts that have not provided me the right answer. If anyone could help me out and point me in any direction they can, I would appreciate it very much


How about you pull 3 digital inputs high with their pullups, and have each connected to the switch. Ground the other side of the switch, so that in each position it grounds one or other of the pins.

Then have some ifs checking to see if pinx piny or pinz is low, and in each if's action you set the temp as A B or C....

Brilliant, thanks for your help.