Skip to content

Getting started

IoliteCoding edited this page Jul 22, 2024 · 3 revisions

In this example there are 4 commands with various purposes.

Using the library

Add this to use the library:

#include <SerialCommands.h>

Serial stream

Creating an instance of the class is not nessesary, Cmd can be used out of the box.
Cmd uses Serial as underlying stream as default. Cmd.begin(*baudrate*) will begin the underlying stream.

void Setup()
{
    Cmd.begin(115200);
}

Changing the stream:

void Setup()
{
    Cmd.init(&Serial1);
    Cmd.begin(115200);
}

Registering the callbacks

About callbacks

Clone this wiki locally