Dynamics of a mechanical object at the quantum level