Motion
Every move goes through one function, servoMove(n, angle). It takes a channel from 0 to 26 and an angle from 0 to 180°, turns the angle into a pulse, and writes it to the first board for channels below 16 or the second board for the rest. No other code needs to know which board a joint is on.
Each gesture is a short Python function that steps joints through angles with pauses between them; most arm moves step one degree every 0.1 s. The handshake reaches out, turns the wrist, closes the fingers halfway for two seconds, opens them and draws back, in about 18.5 s as programmed.