Go to file
Nigreon 19d38903cf Initial commit 2024-07-21 01:32:01 +02:00
boards Initial commit 2024-07-21 01:32:01 +02:00
include Initial commit 2024-07-21 01:32:01 +02:00
lib Initial commit 2024-07-21 01:32:01 +02:00
src Initial commit 2024-07-21 01:32:01 +02:00
test Initial commit 2024-07-21 01:32:01 +02:00
zephyr Initial commit 2024-07-21 01:32:01 +02:00
README.rst Initial commit 2024-07-21 01:32:01 +02:00
compile_commands.json Initial commit 2024-07-21 01:32:01 +02:00
platformio.ini Initial commit 2024-07-21 01:32:01 +02:00
sample.yaml Initial commit 2024-07-21 01:32:01 +02:00

README.rst

.. _uart_sample:

UART Driver Sample
##################

Overview
********

This sample demonstrates how to use the UART serial driver with a simple
echo bot. It reads data from the console and echoes the characters back after
an end of line (return key) is received.

The polling API is used for sending data and the interrupt-driven API
for receiving, so that in theory the thread could do something else
while waiting for incoming data.

By default, the UART peripheral that is normally used for the Zephyr shell
is used, so that almost every board should be supported.

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

Build and flash the sample as follows, changing ``nrf52840dk_nrf52840`` for
your board:

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/uart/echo_bot
   :board: nrf52840dk_nrf52840
   :goals: build flash
   :compact:

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

.. code-block:: console

    Hello! I\'m your echo bot.
    Tell me something and press enter:
    # Type e.g. "Hi there!" and hit enter!
    Echo: Hi there!