From ddbdabcfd01a78ff0b31b38d6ccfb5e30bda96ce Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Wed, 2 Oct 2024 16:04:54 +0200 Subject: [PATCH] Clarify usage of UART mode --- examples/UARTRead/UARTRead.ino | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/examples/UARTRead/UARTRead.ino b/examples/UARTRead/UARTRead.ino index 5454d80..dfbfe71 100644 --- a/examples/UARTRead/UARTRead.ino +++ b/examples/UARTRead/UARTRead.ino @@ -1,19 +1,26 @@ /** * This example shows how to read data from the UART port on the board. - * It is meant to run on a board only connected through UART to the Nicla Sense Env. - * This requires the Nicla Sense Env to be powered through the VIN pin or through - * the ESLOV connector of a host board. - * You will need to connect the UART pins of the Nicla Sense Env to the UART pins of the board. + * It is meant to run on a board ONLY connected through UART to the Nicla Sense Env. + * Boards that have an available I2C interface can connect to the Nicla Sense Env over I2C and read the data + * in a much more efficient way. + * + * A UART-only scenario requires the Nicla Sense Env to be powered through the VIN pin + * as it won't be powered through the ESLOV connector. + * You will need to connect the UART pins of the Nicla Sense Env to the UART pins of the host board. * On many Arduino boards the serial interface associated with those pins is Serial1. * Please check the documentation of your board to find out which serial interface to use. * - * UART output needs to be enabled on the Nicla Sense Env for this example to work. - * You can do so by connecting to the board over I2C to a host board, and running the following code: + * IMPORTANT: UART output needs to be enabled beforehand on the Nicla Sense Env for this example to work. + * You will need an I2C capable board to do so. + * Connect Nicla Sense Env over I2C to that host board, and run the following code: * * NiclaSenseEnv device; - * device.begin(); - * The second parameter ensures that the settings are not lost after a reset - * device.setUARTCSVOutputEnabled(true, true); + * device.begin(); + * device.setUARTCSVOutputEnabled(true, true); // Second parameter ensures that the settings are not lost after a reset + * + * After that you can disconnect the Nicla Sense Env from the I2C host board and connect it to the UART host board. + * You won't need to run the above code again, as the settings are stored permanently. + * The code below is meant to run on the UART-only host board once the UART output is enabled. * * Initial author: Sebastian Romero (s.romero@arduino.cc) *