You're up a bit late, aren't cha? (Or early? Do programmers ever get to see the sun?)

I think it's rc_dig_in03.

Here's some code we had from last year, using joystick 2 y-axis to move the grabber arm up or down (like your lower arm with the motor at the elbow). We had a limit switch (LS) at the top and bottom to stop the motor, but allows it to go the other way even if it reaches the limit switch.

Of course if you're doing autonomous, don't use the joystick! Just remember to cover all possibilities (all if/ifelse/else's) so you know at the end the motors are on or off.

This wasn't our final code, but it did work at the time. As always YMMV.
______________________One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.