zephyr/samples/sensor/isl29035
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
..
boards
src includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
CMakeLists.txt
README.rst
prj.conf sensors: Remove unnecessary Kconfig setting of sensors 2022-07-25 15:18:56 +02:00
sample.yaml

README.rst

.. _isl29035:

ISL29035: Digital Light Sensor
##############################

Overview
********

If trigger is not enabled the sample displays measured light intensity
every 2 seconds.

If trigger is enabled the sample displays light intensity from the
ISL29035 sensor every 10 seconds if it is within +/- 50 lux of the last
read sample.  If the sensor detects an intensity outside that range the
application wakes, displays the intensity, resets the intensity range
window to center on the new value, then continues as before.

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

This sample uses an external breakout for the sensor.  A devicetree
overlay must be provided to connect the sensor to the I2C bus and
identify the interrupt signal.

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

.. zephyr-app-commands::
   :zephyr-app: samples/sensor/isl29035
   :board: nrf52dk_nrf52832
   :goals: build
   :compact:

Sample Output
=============

.. code-block:: console

   *** Booting Zephyr OS build zephyr-v2.1.0-335-gfe020d937d43  ***
   ALERT 365 lux outside range centered on 0 lux.
   Next alert outside 315 .. 415
   [0:00:00.018] Ambient light sense: 365.234
   [0:00:10.023] Ambient light sense: 361.084
   ALERT 302 lux outside range centered on 365 lux.
   Next alert outside 252 .. 352
   [0:00:13.276] Ambient light sense: 302.734
   ALERT 247 lux outside range centered on 302 lux.
   Next alert outside 197 .. 297
   [0:00:14.619] Ambient light sense: 247.62
   ALERT 187 lux outside range centered on 247 lux.
   Next alert outside 137 .. 237
   [0:00:16.141] Ambient light sense: 187.927
   ALERT 126 lux outside range centered on 187 lux.
   Next alert outside 76 .. 176
   [0:00:16.410] Ambient light sense: 126.953
   ALERT 181 lux outside range centered on 126 lux.
   Next alert outside 131 .. 231
   [0:00:17.843] Ambient light sense: 181.03
   ALERT 235 lux outside range centered on 181 lux.
   Next alert outside 185 .. 285
   [0:00:18.022] Ambient light sense: 235.779
   ALERT 301 lux outside range centered on 235 lux.
   Next alert outside 251 .. 351
   [0:00:23.126] Ambient light sense: 301.758
   ALERT 353 lux outside range centered on 301 lux.
   Next alert outside 303 .. 403
   [0:00:23.305] Ambient light sense: 353.333
   [0:00:33.310] Ambient light sense: 365.112

   <repeats as necessary>