zephyr/samples/sensor/soc_voltage
Kenneth J. Miller 529bdf2f85 samples: sensor: Add generic voltage driver example
Add basic sample to demonstrate voltage driver measurements.

Signed-off-by: Kenneth J. Miller <ken@miller.ec>
2023-05-23 08:54:20 +02:00
..
src samples: sensor: Add generic voltage driver example 2023-05-23 08:54:20 +02:00
CMakeLists.txt samples: sensor: Add generic voltage driver example 2023-05-23 08:54:20 +02:00
prj.conf samples: sensor: Add generic voltage driver example 2023-05-23 08:54:20 +02:00
README.rst samples: sensor: Add generic voltage driver example 2023-05-23 08:54:20 +02:00
sample.yaml samples: sensor: Add generic voltage driver example 2023-05-23 08:54:20 +02:00

.. _soc_voltage:

SoC voltage sensor measurement
##############################

Overview
********

This sample reads one or more of the various voltage sensors an SoC might have and
displays the results.

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

In order to run this sample, enable the sensor node that supports
``SENSOR_CHAN_VOLTAGE`` and create an alias named ``volt-sensor0`` to link to the node.
The tail ``0`` is the sensor number.  This sample support up to 16 sensors.

.. zephyr-app-commands::
   :zephyr-app: samples/sensor/soc_voltage
   :board: nucleo_g071rb
   :goals: build
   :compact:

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

.. code-block:: console

   Sensor voltage: 2.99 V