zephyr/samples/sensor/bme280
Martí Bolívar 6e8775ff84 devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:

- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
  for macros which are equivalent to
  DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name

Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.

This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 18:24:42 +02:00
..
boards samples: bme280: nrf52840 DK: set LSB in i2c addr 2020-04-14 10:38:10 -05:00
src devicetree: remove DT_HAS_NODE_STATUS_OKAY 2020-05-13 18:24:42 +02:00
CMakeLists.txt cmake: use find_package to locate Zephyr 2020-03-27 16:23:46 +01:00
Kconfig samples: bme280: enable the appropriate bus by default 2020-04-14 10:38:10 -05:00
README.rst
prj.conf samples: bme280: enable the appropriate bus by default 2020-04-14 10:38:10 -05:00
sample.yaml

README.rst

.. _bme280:

BME280 Humidity and Pressure Sensor
###################################

Overview
********

This sample application periodically reads temperature, pressure and humidity data from
the first available device that implements SENSOR_CHAN_AMBIENT_TEMP, SENSOR_CHAN_PRESS,
and SENSOR_CHAN_HUMIDITY. This sample checks the sensor in polling mode (without
interrupt trigger).

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

This sample application uses an BME280 sensor connected to a board via I2C.
Connect the sensor pins according to the connection diagram given in the `bme280 datasheet`_
at page 38.


.. zephyr-app-commands::
   :zephyr-app: samples/sensor/bme280
   :board: nrf52840dk_nrf52840
   :goals: flash
   :compact:

Sample Output
=============
To check output of this sample , any serial console program can be used.
This example uses ``picocom`` on the serial port ``/dev/ttyACM0``:

.. code-block:: console

        $ sudo picocom -D /dev/ttyUSB0

.. code-block:: console

        temp: 27.950000; press: 100.571027; humidity: 61.014648
        temp: 27.940000; press: 100.570269; humidity: 61.012695
        temp: 27.950000; press: 100.570695; humidity: 61.002929

.. _bme280 datasheet: https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME280-DS002.pdf