Coding
Your
Bionic Finger

Link to the video

The coding of the bionic finger is very important. It enables the servo to move and links the finger angle to the servo angle. There is a link to a video that explains each individual part of the code. We used the Arduino software to type our code, which allowed us to download it onto our Arduino NanoBoards. It is important to calibrate the inputs and outputs of your finger and servo (more information below).
Here is what the final coding looks like:

Changing the code to suit your bionic finger.
The numbers representing the integer angle will change as we need the FlexSensor values and the Servo angles to match up. We can find the FlexSensor values using the serial monitor.
We find the difference of the FlexSensor values (largest-smallest) and divide by whatever number gives an answer closest to 180.
E.g. (700-400)/2 = 150.