Skip to main content

WindSpeed

caution

This service is rc and may change in the future.

A sensor that measures wind speed.

import { WindSpeed } from "@devicescript/core"

const windSpeed = new WindSpeed()

Registers

reading

The velocity of the wind.

  • type: Register<number> (packing format u16.16)

  • read only

import { WindSpeed } from "@devicescript/core"

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

const windSpeed = new WindSpeed()
// ...
windSpeed.reading.subscribe(async (value) => {
...
})
note

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

readingError

Error on the reading

  • type: Register<number> (packing format u16.16)

  • optional: this register may not be implemented

  • read only

import { WindSpeed } from "@devicescript/core"

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

const windSpeed = new WindSpeed()
// ...
windSpeed.readingError.subscribe(async (value) => {
...
})
note

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

maxReading

Maximum speed that can be measured by the sensor.

  • type: Register<number> (packing format u16.16)

  • optional: this register may not be implemented

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

  • read only

import { WindSpeed } from "@devicescript/core"

const windSpeed = new WindSpeed()
// ...
const value = await windSpeed.maxReading.read()
note

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