I have a spring centered analog thumbwheel switch that I need to use in this project. I need help programming a neutral/off range for relays. I found the center/neutral point on thumbwheel switch at approximately what =522.
. This is too sensitive and does not always turn off relays when the thumbwheel switch is centered to the neutral/off position without searching for =522.
Please reference sketch Project 51. The lines I am having difficulty with are highlighted.
are you using an analog input to read the thumb switch?
unless you are very careful and use high quality components one tends to get some noise - use a range, e.g. switch off if reading is in the range 510 to 530???
It could be they are using an analog input and a set of resistors in series, with the switches selecting the several points on the series string. One input to determine which switch is closed. I watched a video that used this method to decode a 16 button keypad.
Or maybe it is a potentiometer, spring centered like a one axis joystick.