Skip to main content

Water

The startWaterLevel starts a simple analog sensor server that models a water level sensor and returns a client bound to the server.

import { gpio } from "@devicescript/core"
import { startWaterLevel } from "@devicescript/servers"

const sensor = startWaterLevel({
pin: ds.gpio(3),
})
sensor.reading.subscribe(level => console.data({ level }))