If you need urgent consulting help click here

Usage

Enable this driver in prj.conf by setting “CONFIG_EXAMPLE_SENSOR=y” in your application.

example_sensor {
        compatible = "example-sensor";
        label = "EXAMPLE_SENSOR";
        gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
        status = "okay";
};

Then in code you can start a new measurement using:

const struct device *dev = device_get_binding("EXAMPLE_DRIVER")
sensor_sample_fetch(dev);
sensor_channel_get(dev, SENSOR_CHAN_AMBIENT_TEMP);