Web Bluetooth: a heart-rate monitor

A Tcl script in this page asks for a Bluetooth device with the Heart Rate service, connects to it, and turns on the notifications of the Heart Rate Measurement characteristic. Each notification shows the rate. Chest straps, watches in a broadcast mode, and fitness trackers have this service. The script runs in ztcl-host.wasm with the grants dom, event, and web:bluetooth.

--bpm

The browser shows its device chooser after the click. The script is below, and the guide to Web Bluetooth tells how it works.