A stimulation device is provided that stimulates breathing to manipulate blood gas concentrations such as SaO2 or PCO2 and thereby treat underlying causes of breathing disorders and heart failure progression. A programmable device is provided for setting diaphragm stimulation waveforms that adjust minute ventilation about a predetermined baseline value. Normal breathing of the subject is observed to establish a baseline reference minute ventilation, and the device is programmed to produce stimulation waveforms that may provide either a decrease or an increase in the patients minute ventilation. The minute ventilation of the subject may be decreased or increased from the baseline level by decreasing or increasing a parameter that changes minute ventilators.