In cardiac optogenetics, cardiac functions of animals such as rat, zebrafish, and fruit fly, are controlled through optical excitation of opsin expressed cardiac tissues. In the last few years, this non-invasive cardiac control method has been developed rapidly as an alternative to the traditional technique of electrical stimulation. However, the strong absorption and scattering of the excitation light needed for commonly used opsins limit the optical penetration depth in tissue, which hampers the development of cardiac optogenetics. In this work, we express red-shifted opsins (ReaChR and halorhodopsin) in the heart of the established Drosophila melanogaster model,and use red-light stimulation for deep penetration of excitation light into the myocardial structures. Mmode images acquired through optical coherence microscopy (OCM) imaging demonstrate controlled heart function in vivo and in real time throughout the life cycle of Drosophila. Fast kinetics, high safety and high heart-rate adjustability were shown with short pulse width, low excitation power density, and wide frequency tuning range, respectively, in the pacing study. Stimulation power was also tuned to characterize the optimal excitation power densities for reliable cardiac function inactivation, which were proved safe for each developmental stage. Both groups of flies exhibited high cardiac stimulation efficiencies. This study demonstrates non-invasive cardiac control through activating and inhibiting heart functions of an intact animal, which is promising for scientific study and clinical treatment of cardiac diseases, such as congenital or posteriority bradycardia, tachycardia, and regional mechanical dys-synchrony.