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