updated example and readme

This commit is contained in:
Nick Leeman 2021-04-13 14:32:42 +02:00
parent d7d2ff4248
commit 65061d53b1
2 changed files with 3 additions and 3 deletions

View File

@ -66,12 +66,12 @@ SimpleSerialProtocol device;
``` ```
Initialize the serial device and connection. Initialize the serial device and connection.
First parameter is the serial channel. For example; the mega 2560 has 4 serial channels (RX0/TX0 through RX3/TX3) First parameter is a serial object. For example; the mega 2560 has 4 serial channels (RX0/TX0 through RX3/TX3) so Serial, Serial1, Serial2 ... etc.
Second parameter is the baud rate. Second parameter is the baud rate.
```c++ ```c++
void setup() { void setup() {
// Initialize serial device on index 0 with a baud rate of 115200 // Initialize serial device on index 0 with a baud rate of 115200
device.init(0, 115200); device.init(Serial, 115200);
} }
``` ```

View File

@ -18,7 +18,7 @@ void onPacket(Packet packet) {
void setup() { void setup() {
// Initialize (deviceOne) serial device on index 0 with a baud rate of 115200. // Initialize (deviceOne) serial device on index 0 with a baud rate of 115200.
deviceOne.init(0, 115200); deviceOne.init(Serial, 115200);
} }
void loop() { void loop() {