Step 7: Program the Hand

Picture of Program the Hand
I have attached the code from my first version. That time, I used two regular Arduinos since I needed 8 Analog In pins. It also isolated the two processes going on: positioning the fingers and measuring the pressures. For my second version (this version) I used an Arduino Mega, so I could fit all of the inputs on one board. As for the code, I pretty much copied and pasted the servo positioning into the pressure reading loop and changed the pin labels around.

For the servo positioning, there still needs to be some work done on limiting the rotation. If they rotate too far, something may break. This is how I broke the finger. 

As I said in the intro, I will always come back to this project to try to improve it bit by bit. Since this is one of my first Arduino programs, there are most likely some inefficiencies in the code. Feel free to post potential modifications.