Motor drives a mechanical cam