How to Detect a Pattern

Hi, thanks for your input. For the time being i will just be starting off with a simple combination and see how it goes. As i will be running it along side other code that will also control the motor, using the same force sensor i may find i have to make the combination more precise so it only goes off when its actually needed, not randomly.