SevenSegmentDisplay
This service is rc and may change in the future.
A 7-segment numeric display, with one or more digits.
import { SevenSegmentDisplay } from "@devicescript/core"
const sevenSegmentDisplay = new SevenSegmentDisplay()
Commands
setNumber
Shows the number on the screen using the decimal dot if available.
sevenSegmentDisplay.setNumber(value: number): Promise<void>
Registers
intensity
Controls the brightness of the LEDs. 0
means off.
type:
Register<number>
(packing formatu0.16
)optional: this register may not be implemented
read and write
import { SevenSegmentDisplay } from "@devicescript/core"
const sevenSegmentDisplay = new SevenSegmentDisplay()
// ...
const value = await sevenSegmentDisplay.intensity.read()
await sevenSegmentDisplay.intensity.write(value)
- track incoming values
import { SevenSegmentDisplay } from "@devicescript/core"
const sevenSegmentDisplay = new SevenSegmentDisplay()
// ...
sevenSegmentDisplay.intensity.subscribe(async (value) => {
...
})
write
and read
will block until a server is bound to the client.
doubleDots
Turn on or off the column LEDs (separating minutes from hours, etc.) in of the segment. If the column LEDs is not supported, the value remains false.
type:
Register<boolean>
(packing formatu8
)optional: this register may not be implemented
read and write
import { SevenSegmentDisplay } from "@devicescript/core"
const sevenSegmentDisplay = new SevenSegmentDisplay()
// ...
const value = await sevenSegmentDisplay.doubleDots.read()
await sevenSegmentDisplay.doubleDots.write(value)
- track incoming values
import { SevenSegmentDisplay } from "@devicescript/core"
const sevenSegmentDisplay = new SevenSegmentDisplay()
// ...
sevenSegmentDisplay.doubleDots.subscribe(async (value) => {
...
})
write
and read
will block until a server is bound to the client.
digitCount
The number of digits available on the display.
type:
Register<number>
(packing formatu8
)constant: the register value will not change (until the next reset)
read only
import { SevenSegmentDisplay } from "@devicescript/core"
const sevenSegmentDisplay = new SevenSegmentDisplay()
// ...
const value = await sevenSegmentDisplay.digitCount.read()
write
and read
will block until a server is bound to the client.
decimalPoint
True if decimal points are available (on all digits).
type:
Register<boolean>
(packing formatu8
)optional: this register may not be implemented
constant: the register value will not change (until the next reset)
read only
import { SevenSegmentDisplay } from "@devicescript/core"
const sevenSegmentDisplay = new SevenSegmentDisplay()
// ...
const value = await sevenSegmentDisplay.decimalPoint.read()
write
and read
will block until a server is bound to the client.