This maybe as a result of some reaction of the medications you are taking to cure the heart disease just as Audrey have said, you may also be suffering from Arteriosclerosis (Cholesterol that blocks the arteries) or Diabetes, this two conditions may hinders the correct flow of blood to the penis cavities, if the blood pressure inside the penis is not enough this will affect your erection.
I will suggest you take nutrition rich in Zinc, Vitamin E and other vitamins such as B1, B5, B6 and B12, Vitamin E and Zinc in particular are very useful, they can be found in some types of sea foods such as Oysters.
Also try as mush as possible to avoid stress. Good luck.