Light Level
The startLightLevel
starts a simple analog sensor server that models a light level sensor
and returns a client bound to the server.
- Please refer to the analog documentation for details.
import { gpio } from "@devicescript/core"
import { startLightLevel } from "@devicescript/servers"
const sensor = startLightLevel({
pin: ds.gpio(3),
})
sensor.reading.subscribe(light => console.data({ light }))