dht2x-device

xod-dev/dht/dht2x-device

Represents a DHT21 or compatible sensor: DHT21, DHT22, DHT33, DHT44, AM2301, HM2301, AM2302, AM2303, RHT02, RHT03, RHT04, RHT05.
dht2x-device
@/dht2x-device
Represents a DHT21 or compatible sensor: DHT21, DHT22, DHT33, DHT44, AM2301, HM2301, AM2302, AM2303, RHT02, RHT03, RHT04, RHT05.
PORTport
Board port number the hygrometer is connected to.
dht2x-device
PORT
DEV
DEV@/dht2x-device
To use the node in your project you should have the xod-dev/dht library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

node {
    meta {
      struct Type {
         static constexpr typeof_PORT port = constant_input_PORT;
      };
    }

    void evaluate(Context ctx) {
        static_assert(isValidDigitalPort(constant_input_PORT), "must be a valid digital port");

        // just to trigger downstream nodes
        emitValue<output_DEV>(ctx, {});
    }
}