Skip to main content

PulseOximeter

caution

This service is experimental and may change in the future.

A sensor approximating the oxygen level.

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 { PulseOximeter } from "@devicescript/core"

const pulseOximeter = new PulseOximeter()

Registers

reading

The estimated oxygen level in blood.

  • type: Register<number> (packing format u8.8)

  • read only

import { PulseOximeter } from "@devicescript/core"

const pulseOximeter = new PulseOximeter()
// ...
const value = await pulseOximeter.reading.read()
  • track incoming values
import { PulseOximeter } from "@devicescript/core"

const pulseOximeter = new PulseOximeter()
// ...
pulseOximeter.reading.subscribe(async (value) => {
...
})
note

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 format u8.8)

  • optional: this register may not be implemented

  • read only

import { PulseOximeter } from "@devicescript/core"

const pulseOximeter = new PulseOximeter()
// ...
const value = await pulseOximeter.readingError.read()
  • track incoming values
import { PulseOximeter } from "@devicescript/core"

const pulseOximeter = new PulseOximeter()
// ...
pulseOximeter.readingError.subscribe(async (value) => {
...
})
note

write and read will block until a server is bound to the client.