Skip to main content

Soil Moisture

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

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

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