Techniques for pacing the heart of a patient as a function of a pressure value make use of a pressure monitor that receives a signal from a pressure sensor in the heart. The pressure monitor measures a pressure value. The pressure monitor may, for example, estimate the pulmonary artery diastolic pressure if the pressure sensor is located in the right ventricle, or calculate the mean central venous pressure if pressure sensor is located in the right atrium. The energy level of the pacing pulses delivered to the patients heart by a pacemaker is modulated as a function of the pressure value. Modulating the energy level of the pacing pulses modulates the cardiac output of the patients heart.