how do I animate a geneva drive with animation nodes?
Here my solution:




First, I use modulo to get 360-rotation cycle.
Next I divide degrees to get 0-1 range.
When I use Curve interpolation to mach each cycle with rotation of secondary object. (Curve is drawn by hand)
Finally, get back to degrees with some scale (6 times smaller) 




Note, that i'm don't care about real 360-degree rotation of secondary shape. It rotates in 0-60 degree range. If you want to get real rotation, you need to add each cycle to the result. 

UPD: 


  It works for this example where there is only those two gears, but not
  for what I need because it will control a whole clock gear system, so
  the second gear can't have its rotation being reseted


As I noted, If you want to get real rotation, you need to add each cycle to the result:



To get cycle number you need to divide rotation by 360, and convert result to integer using Floor function. When just multiply it by same number, -60 and add it to rotation