Hi all, I’m working on a project to make use of some resistance based buttons on my steering wheel, however I’m having a little trouble figuring out one aspect of it.
I’ll be reading the analog input of the buttons on a couple analog pins, I haven’t hooked my arduino up to them yet for exact numbers, just the resistance values themselves, and the resistance is about 47k when nothing is pressed, and changes based on whichever button is pressed.
I’m looking for a way that I can detect double and long presses of these buttons, based on checking the resistance, so if it falls within x amount and is pressed twice I can do one thing, or press and hold to do another.
Should be fairly simple but all the examples I can find are for regular push buttons connecting to ground, so I’m not quite sure how to implement it with reading an analog value.
edit: odd, my if statement for checking the resistance isn’t working either, it won’t trigger pin2 for some reason.
val1 = analogRead(radioinput);
if (val1>=950 && val1<=800) digitalWrite(2, LOW);
maybe it has to do with there being a constant higher reading if I don’t connect a resistor on that input, but I also tried setting val1 to zero if it was the usual output and that didn’t work either.
Man I must be rusty.