Skip to main content

AirPressure

caution

This service is rc and may change in the future.

A sensor measuring air pressure of outside environment.

import { AirPressure } from "@devicescript/core"

const airPressure = new AirPressure()

Registers

reading

The air pressure.

  • type: Register<number> (packing format u22.10)

  • read only

import { AirPressure } from "@devicescript/core"

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

const airPressure = new AirPressure()
// ...
airPressure.reading.subscribe(async (value) => {
...
})
note

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

readingError

The real pressure is between pressure - pressure_error and pressure + pressure_error.

  • type: Register<number> (packing format u22.10)

  • optional: this register may not be implemented

  • read only

import { AirPressure } from "@devicescript/core"

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

const airPressure = new AirPressure()
// ...
airPressure.readingError.subscribe(async (value) => {
...
})
note

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

minReading

Lowest air pressure that can be reported.

  • type: Register<number> (packing format u22.10)

  • optional: this register may not be implemented

  • constant: the register value will not change (until the next reset)

  • read only

import { AirPressure } from "@devicescript/core"

const airPressure = new AirPressure()
// ...
const value = await airPressure.minReading.read()
note

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

maxReading

Highest air pressure that can be reported.

  • type: Register<number> (packing format u22.10)

  • optional: this register may not be implemented

  • constant: the register value will not change (until the next reset)

  • read only

import { AirPressure } from "@devicescript/core"

const airPressure = new AirPressure()
// ...
const value = await airPressure.maxReading.read()
note

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