zephyr/samples/sensor/ti_hdc
Marc Herbert 2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
..
boards samples: sensor: ti_hdc: Move dts overlays under boards 2020-04-01 10:44:31 -04:00
src device: Fix structure attributes access 2020-05-08 23:07:44 +02:00
CMakeLists.txt samples: make find_package(Zephyr...) REQUIRED 2020-05-29 10:47:25 +02:00
prj.conf samples: added sample for ti_hdc 2019-06-11 10:17:11 -05:00
README.rst doc: fix broken file and zephyr-app refs 2019-10-08 15:42:32 -05:00
sample.yaml tests: fix test identifiers 2019-12-09 15:53:44 -05:00

.. _ti_hdc_sample:

TI_HDC Sample
##############

Description
***********

This sample application periodically takes Temperature and Humidity
using the ti_hdc sensor driver. The result is written to the console.

Requirements
************

This sample needs a compatible sensor like HDC1010 or HDC1080
connected to the target board's I2C connector.

Example Breakout Boards:

* Pmod HYGRO: Humidity and Temperature Sensor Breakout board


Wiring
******

This sample is tested with the STM32L496ZG nucleo and the Pmod HYGRO
Temp/RH breakout board.

The sensor operates at 3.3V and uses I2C to communicate with the board.

External Wires:

* Breakout **GND** pin <--> Nucleo **GND** pin
* Breakout **VCC** pin <--> Nucleo **3V3** pin
* Breakout **SDA** pin <--> Nucleo **CN7-D14** pin
* Breakout **SCL** pin <--> Nucleo **CN7-D15** pin

Building and Running
********************

This sample builds one application for the HDC1080 sensor.
Build/Flash Steps:

.. zephyr-app-commands::
   :zephyr-app: samples/sensor/ti_hdc/
   :board: nucleo_l496zg
   :goals: build flash
   :compact:

Sample Output
*************
.. code-block:: console

    Running on arm!
    Dev 0x20001160 name HDC1080 is ready!
    Fetching...
    Raw Temp = 25144, Temp = 23.305053 C, Raw RH = 32292, RH = 49.273681 %
    Fetching...
    Raw Temp = 25148, Temp = 23.315124 C, Raw RH = 32424, RH = 49.475097 %
    ...

Build Testing
**************

.. code-block:: bash

    $ZEPHYR_BASE/scripts/sanitycheck -T $ZEPHYR_BASE/samples/sensor/ti_hdc/ -p nucleo_l496zg --device-testing --device-serial /dev/ttyACM0 -t build

Target Testing
**************

.. code-block:: bash

    $ZEPHYR_BASE/scripts/sanitycheck -T $ZEPHYR_BASE/samples/sensor/ti_hdc/ -p nucleo_l496zg --device-testing --device-serial /dev/ttyACM0 -t target


References
**********

.. _Nucleo STM32L496ZG board: https://www.st.com/en/evaluation-tools/nucleo-l496zg.html
.. _HDC1080 Breakout board: https://store.digilentinc.com/pmod-hygro-digital-humidity-and-temperature-sensor/