My colleague Jan Wessel Hovingh had an interesting question: How would it feel for a presenter and what would it do to the audience to show the heartrate of the presenter while presenting?
I decided to make a proof of concept to make it possible for him to research this question. In this blogpost I will explain how to get the heartrate of an Apple Watch and how to show it on a Keynote presentation. Beware: It is a hacky solution!
1. Get the heartrate
To get the heartrate I decided to use Apple Shortcuts App. Apple Shortcuts allows you to look up the most recent Heartrate recorded in Healthkit. The heartrate is stored in a variable, and used as parameter to a websservice. Because the Apple watch syncs the heartrate to Healtkit every several seconds its not completely “live”. But it improves when the workout mode is active on the Apple Watch.
2. Receive the heartrate
On a heroku server I deployed a simple Ruby Sinatra script. It exposes a url that can receive one parameter: the heartrate. The heartrate is than send to a “pusher” channel. Pusher creates channels that can be listened to from loads of techniques.
4. Attach it to Keynote
The programs I usually create are written with maintenance in my mind. I strive to make my code clear, simple and structured. For this hack project I gave myself permission to break all the rules, to not follow any code conventions, to not work like a professional. Nice and fun!