Skip to main content

RainGauge

caution

This service is rc and may change in the future.

Measures the amount of liquid precipitation over an area in a predefined period of time.

import { RainGauge } from "@devicescript/core"

const rainGauge = new RainGauge()

Registers

reading

Total precipitation recorded so far.

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

  • read only

import { RainGauge } from "@devicescript/core"

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

const rainGauge = new RainGauge()
// ...
rainGauge.reading.subscribe(async (value) => {
...
})
note

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

readingResolution

Typically the amount of rain needed for tipping the bucket.

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

const rainGauge = new RainGauge()
// ...
const value = await rainGauge.readingResolution.read()
note

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