CharacterScreen
This service is rc and may change in the future.
A screen that displays characters, typically a LCD/OLED character screen.
import { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
Registers
message
Text to show. Use \n
to break lines.
type:
Register<string>
(packing formats
)read and write
import { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
// ...
const value = await characterScreen.message.read()
await characterScreen.message.write(value)
- track incoming values
import { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
// ...
characterScreen.message.subscribe(async (value) => {
...
})
write
and read
will block until a server is bound to the client.
intensity
Brightness of the screen. 0
means off.
type:
Register<number>
(packing formatu0.16
)optional: this register may not be implemented
read and write
import { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
// ...
const value = await characterScreen.intensity.read()
await characterScreen.intensity.write(value)
- track incoming values
import { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
// ...
characterScreen.intensity.subscribe(async (value) => {
...
})
write
and read
will block until a server is bound to the client.
variant
Describes the type of character LED screen.
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 { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
// ...
const value = await characterScreen.variant.read()
write
and read
will block until a server is bound to the client.
textDirection
Specifies the RTL or LTR direction of the text.
type:
Register<number>
(packing formatu8
)optional: this register may not be implemented
read and write
import { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
// ...
const value = await characterScreen.textDirection.read()
await characterScreen.textDirection.write(value)
- track incoming values
import { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
// ...
characterScreen.textDirection.subscribe(async (value) => {
...
})
write
and read
will block until a server is bound to the client.
rows
Gets the number of rows.
type:
Register<number>
(packing formatu8
)constant: the register value will not change (until the next reset)
read only
import { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
// ...
const value = await characterScreen.rows.read()
write
and read
will block until a server is bound to the client.
columns
Gets the number of columns.
type:
Register<number>
(packing formatu8
)constant: the register value will not change (until the next reset)
read only
import { CharacterScreen } from "@devicescript/core"
const characterScreen = new CharacterScreen()
// ...
const value = await characterScreen.columns.read()
write
and read
will block until a server is bound to the client.