zephyr/samples/sensor/tmp116
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: tmp116: 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: sensor: tmp116: Add sample for TMP116 2019-10-04 15:31:56 -05:00
README.rst doc: fix misspellings in rst docs 2019-10-29 06:01:13 +01:00
sample.yaml tests: fix test identifiers 2019-12-09 15:53:44 -05:00

.. _ti_tmp116_sample:

TI_TMP116 Sample
################

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

This sample application periodically takes temperature readings using the ti_tmp116
sensor driver. The result is written to the console.

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

This sample needs a TI TMP116 sensor connected to the target board's I2C
connector.


Wiring
******

This sample is tested with Nucleo STM32F401RE 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 **CN5-D14** pin
* Breakout **SCL** pin <--> Nucleo **CN5-D15** pin

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

In order to build the sample, connect the board to the computer with a USB cable and enter the
following commands:

.. zephyr-app-commands::
   :zephyr-app: samples/sensor/tmp116
   :board: nucleo_f401re
   :goals: build flash
   :compact:

Sample Output
*************
The output can be seen via a terminal emulator (e.g. minicom). Connect the board with a USB cable
to the computer and open /dev/ttyACM0 with the below serial settings:

* Baudrate: 115200
* Parity: None
* Data: 8
* Stop bits: 1

The output should look like this:

.. code-block:: console

    Device TMP116 - 0x200010a8 is ready
    temp is 26.7031250 oC
    temp is 26.7109375 oC
    ...