I'm making a hidden keypad using multiple force sensors (force sensitive resistors) behind a thin sheet of material. I'm trying to get down a certain combination, such as ForceSensor1 followed by ForceSensor2 as a simple combination.
My first hurdle is trying to get the code to wait for input from a force sensor while continuously getting those same force sensor values. I was thinking to maybe use interrupts, but the force sensors use analog input.
I just need to wait for input from an analog resistor, take that input and check it, wait for the next input from a different analog resister, take that input and check it, so on and so forth.
What would be the best way of accomplishing this?
How about an array of analogue pins polled sequentially in the loop() function ?
When an input is detected act on it
The Arduino never gets bored. If you program it to read the switches thousands of times per second then it will keep doing that for years "waiting" for you to push one.
Deadpixel:
My first hurdle is trying to get the code to wait for input from a force sensor while continuously getting those same force sensor values.
I don't understand that with sufficient clarity to suggest a solution. And I suspect you, as author, need to think in more detail about what you want to happen.
I would be very surprised if there is any need to use interrupts to achieve a solution.
Write down what you want to happen as a sequence of steps with one step on each line. When you have got that clear then writing code to implement it should be straightforward.
...R