Implementing finger´s sensor

We are trying to use the fingers sensor so the robot can grab books of different thickness. Then the idea would be that the fingers close until they detect certain pressure.

I tested the sensors fo the fingers and they work, we can see different values of pressure. But i did this test using an arduino, not using the robot, so i don't know how to add the pressure conditions to the gesture.