From 19c57af28e132dacab1a12e98fc3b6f009e1131c Mon Sep 17 00:00:00 2001 From: Nick Leeman Date: Tue, 30 Mar 2021 14:43:03 +0200 Subject: [PATCH] Update 'README.md' --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 203f948..8234ad8 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ As you can see the packet starts and ends with ``< - >`` characters and the stag `This means you can't use any of these characters as data in the packets!!` Include SSP and define a new device. -```C++ +```c++ #include // Define new device @@ -68,7 +68,7 @@ SimpleSerialProtocol device; 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) Second parameter is the baud rate. -```C++ +```c++ void setup() { // Initialize serial device on index 0 with a baud rate of 115200 device.init(0, 115200); @@ -76,7 +76,7 @@ void setup() { ``` Now create a method (with a packet parameter) which will be called when a packet is received. In the main loop call ``receivePackets`` with the callback function as parameter regularly. (more times the better) -```C++ +```c++ void onPacket(Packet packet) { Serial.println("Received Packet!"); Serial.println(packet.id); @@ -91,7 +91,7 @@ void loop() { } ``` To send packets you can use the ``sendPacket`` method. -```C++ +```c++ deviceOne.sendPacket("IDPacket", "Commandhere", "testtest"); ``` ## Contributing