updated readme
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user