The purpose of this rudimentary step is to learn to direct outputs to GPIO pins and build proper circuits.
The purpose of this step is to learn how to control a micro servo motor using GPIO.PWM.
The first challenge was figuring out how to provide a consistent 5V/1000mA power source. This was remedied by cutting the head off of a micro-USB cable and connecting each exposed lead to a lead with a GPIO-compatible pin. These cables can then be attached to 5V/1000mA power sources e.g. battery packs.
When using GPIO.PWM with servo motors, pulse width indicates which angle the servo is to be set at. Servos have a range of 180 degrees, and the servo is updated every 20 milliseconds. A 1ms pulse sets it to 0 degrees, 1.5ms pulse to 90 degrees, and 2ms pulse to 180 degrees.
It was found that a 90 degree rotation produced flexion in a finger.
By combining the key input to GPIO pin output with GPIO.PWM controls and several battery packs, the five servo motors are able to be switched between flexed and relaxed positions individually and in groupings to produce hand gestures.
Mapping "H" to the thumb, "J" to the index finger, "K" to the middle finger, "L" to the fourth finger, and ";" to the pinky, and parsing out raw input using spaces as deliminators, single finger movements as well as hand gestures are possible.
The mount in which the servos are seated was fabricated using wood, and the servos were individually disassembled, mounted, glued in, and reassembled. The tendons were upgraded from sewing thread to a polymer-core cord with a braided cover and installed at an optimal tension.
A utility program to test servo function and set each servo to the "zero" position was developed for convenience.
Wiring was reorganized to isolate each finger's controls and power as much as possible to reduce "chatter" seen while servos were at rest.
test1.py code was further refined to increase flexion to the maximum.
Overall, function remains the same. Main differences are in hardware and organization.
Final note on wiring: all grounds should be able to be linked to the same ground pin.