Up-Down Motion and Reverse Deg. Rotation

Input: green cam crank shaft.
Output: brown T-bar moving up-down and turning 180 deg. in two direction at it upper position.