In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:
```python
from pathlib import Path
import re
EXTENSIONS = ("c", "h", "cpp", "rst")
for p in Path(".").glob("samples/**/*"):
if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
continue
content = ""
with open(p) as f:
for line in f:
m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
if (m and
not m.group(2).startswith("zephyr/") and
(Path(".") / "include" / "zephyr" / m.group(2)).exists()):
content += (
m.group(1) +
"#include <zephyr/" + m.group(2) +">" +
m.group(3) + "\n"
)
else:
content += line
with open(p, "w") as f:
f.write(content)
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
|
||
|---|---|---|
| .. | ||
| src | ||
| CMakeLists.txt | ||
| prj.conf | ||
| README.rst | ||
| sample.yaml | ||
.. _hts221:
HTS221: Temperature and Humidity Monitor
########################################
Overview
********
This sample periodically reads temperature and humidity from the HTS221
Temperature & Humidity Sensor and displays it on the console
Requirements
************
This sample uses the HTS221 sensor controlled using the I2C interface.
References
**********
- HTS211: http://www.st.com/en/mems-and-sensors/hts221.html
Building and Running
********************
This project outputs sensor data to the console. It requires an HTS221
sensor, which is present on the disco_l475_iot1 board.
.. zephyr-app-commands::
:zephyr-app: samples/sensor/hts221
:board: disco_l475_iot1
:goals: build
:compact:
Sample Output
=============
.. code-block:: console
Temperature:25.3 C
Relative Humidity:40%
Temperature:25.3 C
Relative Humidity:40%
Temperature:25.3 C
Relative Humidity:40%
Temperature:25.3 C
Relative Humidity:40%
<repeats endlessly every 2 seconds>