Temperature
A thermometer measuring outside or inside environment.
import { Temperature } from "@devicescript/core"
const temperature = new Temperature()
Registers
reading
The temperature.
type:
Register<number>(packing formati22.10)read only
import { Temperature } from "@devicescript/core"
const temperature = new Temperature()
// ...
const value = await temperature.reading.read()
- track incoming values
import { Temperature } from "@devicescript/core"
const temperature = new Temperature()
// ...
temperature.reading.subscribe(async (value) => {
...
})
write and read will block until a server is bound to the client.
minReading
Lowest temperature that can be reported.
type:
Register<number>(packing formati22.10)constant: the register value will not change (until the next reset)
read only
import { Temperature } from "@devicescript/core"
const temperature = new Temperature()
// ...
const value = await temperature.minReading.read()
write and read will block until a server is bound to the client.
maxReading
Highest temperature that can be reported.
type:
Register<number>(packing formati22.10)constant: the register value will not change (until the next reset)
read only
import { Temperature } from "@devicescript/core"
const temperature = new Temperature()
// ...
const value = await temperature.maxReading.read()
write and read will block until a server is bound to the client.
readingError
The real temperature is between temperature - temperature_error and temperature + temperature_error.
type:
Register<number>(packing formatu22.10)optional: this register may not be implemented
read only
import { Temperature } from "@devicescript/core"
const temperature = new Temperature()
// ...
const value = await temperature.readingError.read()
- track incoming values
import { Temperature } from "@devicescript/core"
const temperature = new Temperature()
// ...
temperature.readingError.subscribe(async (value) => {
...
})
write and read will block until a server is bound to the client.
variant
Specifies the type of thermometer.
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 { Temperature } from "@devicescript/core"
const temperature = new Temperature()
// ...
const value = await temperature.variant.read()
write and read will block until a server is bound to the client.