Slider
A slider or rotary potentiometer.
import { Potentiometer } from "@devicescript/core"
const potentiometer = new Potentiometer()
Registers
reading
The relative position of the slider.
- read only
import { Potentiometer } from "@devicescript/core"
const potentiometer = new Potentiometer()
const value = await potentiometer.reading.read()
- track incoming values
import { Potentiometer } from "@devicescript/core"
const potentiometer = new Potentiometer()
potentiometer.reading.subscribe(async (value) => {
...
})
variant
Specifies the physical layout of the potentiometer.
- read only
import { Potentiometer } from "@devicescript/core"
const potentiometer = new Potentiometer()
// ...
const value = await potentiometer.variant.read()