How can you tell when your heart rate is in the right range? You can wear a smart watch, but their screens are small and hard to look at while you are working out. Thanks to a little bit of software, you can now take heart rate data from your Hexiwear and pipe it to the DOTTI digital display.
The Hexiwear is a great start to an IOT sensor project -- it's got a ton of sensors built in, and the Bluetooth LE is straigtforward to connect to. It even has a rechargable battery, so you're never stuck needing hunt for an expensive battery. And the Hexiwear is even better when you can connect it to other Bluetooth devices like the DOTTI pixel display.
The problem is that IOT apps only communicate with a single device. The Hexiwear app can only talk to the Hexiwear device, not other random devices.
The solution is to connect the two devices with a Windows app called Best Calculator with Bluetooth. Best Calculator has long been programmable in BASIC. The latest version of Best Calculator (currently in Alpha) extends the BC BASIC language and lets you control multiple Bluetooth devices. A simple program is presented that reads in pulse data from a Hexiwear and creates a simple but effective graph on a large DOTTI 8x8 color display.
The final graph on the DOTTI device looks something like this
The green band in the middle is the good zone; you want your heart rate to fall into that. Outside is a dimmer blue-ish zone. When your heart rate is outside the green zone, it shows as red.
This video explains how to program in BC BASIC with Bluetooth support.
The overall heart rate code structure is quite simple:
There is a little bit of initialization, and then a main loop where we get the latest heart rate, remove the old dot and add in the new dot.
Comments