suda-morris/am2302_rmt

1.0.0

uploaded 9 months ago
Driver for AM2302 (DHT22) Sensor (RMT backend)

readme

# AM2302 (a.k.a. DHT22) Sensor Driver

[![Component Registry](https://components.espressif.com/components/suda-morris/am2302_rmt/badge.svg)](https://components.espressif.com/components/suda-morris/am2302_rmt)

## Reference Link

* [AM2302 Data Sheet](https://files.seeedstudio.com/wiki/Grove-Temperature_and_Humidity_Sensor_Pro/res/AM2302-EN.pdf)

changelog

## 1.0.0

- Initial driver version, with the RMT driver as backend controller

readme of get_started example

                                        
                                        # AM2302/DHT22 Example

This example demonstrates how to read the temperature and humidity by using the [am2302_rmt](https://components.espressif.com/component/suda-morris/am2302_rmt) library.

## How to Use Example

### Hardware Required

* A development board with Espressif SoC
* A USB cable for Power supply and programming
* AM2302/DHT22 sensor

### Configure the Example

Before project configuration and build, be sure to set the correct chip target using `idf.py set-target <chip_name>`. Then assign the proper GPIO in the [source file](main/am2302_example_main.c).

### Build and Flash

Run `idf.py -p PORT build flash monitor` to build, flash and monitor the project.

(To exit the serial monitor, type ``Ctrl-]``.)

See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects.

## Example Output

```text
I (314) main_task: Started on CPU0
I (324) main_task: Calling app_main()
I (324) gpio: GPIO[2]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (334) gpio: GPIO[2]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0
I (344) example: Start reading temperature and humidity from AM2302 sensor
I (2384) example: Temperature: 29.2 °C, Humidity: 89.3 %
I (4414) example: Temperature: 29.2 °C, Humidity: 88.1 %
```

                                    

Links

Supports all targets

License: Apache-2.0

To add this component to your project, run:

idf.py add-dependency "suda-morris/am2302_rmt^1.0.0"

or download archive

Dependencies

  • ESP-IDF >=5.0
  • Examples:

    get_started

    more details

    To create a project from this example, run:

    idf.py create-project-from-example "suda-morris/am2302_rmt^1.0.0:get_started"

    or download archive

    Stats

    • Downloaded in total
      Downloaded in total 129 times
    • Downloaded this version
      This version: 129 times

    Badge

    suda-morris/am2302_rmt version: 1.0.0
    |