Mechanism driven by cams engaging rotating roller