samples: sensor: dht_polling run sample on sensor present

Add a fixture to run the sample only when the DHT sensor
HX330x is present (shield) on the nucleo_f40re board
'fixture_i2c_hs300x'
The stm32f401 Nucleo board itself has no sensor mounted

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2024-04-02 10:41:04 +02:00 committed by Anas Nashif
parent 0af0187095
commit 298bf49048
2 changed files with 12 additions and 1 deletions

View File

@ -23,7 +23,17 @@ be aliased as ``dhtN`` where ``N`` goes from ``0`` to ``9``. For example:
};
};
Make sure the aliases are in devicetree, then build and run with:
Make sure the aliases are in devicetree.
It also requires a correct fixture setup when the sensor is present.
For the correct execution of that sample in twister, add into boards's
map-file next fixture settings::
- fixture: fixture_i2c_hs300x
Then build and run with:
.. zephyr-app-commands::
:zephyr-app: samples/sensor/dht_polling

View File

@ -15,6 +15,7 @@ tests:
- nucleo_f401re
harness: console
harness_config:
fixture: fixture_i2c_hs300x
type: one_line
regex:
- "[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]*: temp is (.*) °C humidity is (.*) %RH"