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