updated readme

This commit is contained in:
2021-05-01 20:24:28 +02:00
parent ae2a092fab
commit 929f4042e0
2 changed files with 9 additions and 16 deletions

View File

@@ -8,12 +8,12 @@ SimpleSerialProtocol deviceOne;
void onPacket(Packet packet) {
Serial.println("Received Packet!");
Serial.println(packet.id);
Serial.println(packet.command);
Serial.println(packet.type);
Serial.println(packet.data);
Serial.println("----------------");
// To send a packet
deviceOne.sendPacket("IDPacket", "Commandhere", "testtest");
deviceOne.sendPacket("IDPacket", "TypeHere", "testtest");
}
void setup() {
@@ -25,8 +25,5 @@ void loop() {
// Call receive packets function (looping) to handle incoming serial packets.
// If a complete packet has been received it will call the callback function (onPacket).
deviceOne.receivePackets(onPacket);
// Small delay to not over overwork CPU.
delay(1);
}