HeartRate
This service is experimental and may change in the future.
A sensor approximating the heart rate.
Jacdac is NOT suitable for medical devices and should NOT be used in any kind of device to diagnose or treat any medical conditions.
import { HeartRate } from "@devicescript/core"
const heartRate = new HeartRate()
Registers
reading
The estimated heart rate.
type:
Register<number>
(packing formatu16.16
)read only
import { HeartRate } from "@devicescript/core"
const heartRate = new HeartRate()
// ...
const value = await heartRate.reading.read()
- track incoming values
import { HeartRate } from "@devicescript/core"
const heartRate = new HeartRate()
// ...
heartRate.reading.subscribe(async (value) => {
...
})
write
and read
will block until a server is bound to the client.
readingError
The estimated error on the reported sensor data.
type:
Register<number>
(packing formatu16.16
)optional: this register may not be implemented
read only
import { HeartRate } from "@devicescript/core"
const heartRate = new HeartRate()
// ...
const value = await heartRate.readingError.read()
- track incoming values
import { HeartRate } from "@devicescript/core"
const heartRate = new HeartRate()
// ...
heartRate.readingError.subscribe(async (value) => {
...
})
write
and read
will block until a server is bound to the client.
variant
The type of physical sensor
type:
Register<number>
(packing formatu8
)optional: this register may not be implemented
constant: the register value will not change (until the next reset)
read only
import { HeartRate } from "@devicescript/core"
const heartRate = new HeartRate()
// ...
const value = await heartRate.variant.read()
write
and read
will block until a server is bound to the client.