Artificial (implantable) pacemakers are mostly regulated by a sensor that recognizes motion.
It's similar to the sensor that changes your phone/ipads display from portrait to landscape, based on the direction of the device. There are other sensors, such as ones that measure the density of blood in the heart
and chest motion (simulating breathing). Get your routine pacemaker