Skip to content

Commit

Permalink
Update example for the Serial Monitor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Mackrodt authored and Eric Mackrodt committed Apr 9, 2018
1 parent c379d2f commit ba67073
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions examples/HardwareSerial.ino → examples/SerialMonitor.ino
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
#import <SerialMessenger.h>

String channels[] = {
"Channel1",
"Channel2"
};

SerialMessenger messenger(channels);
SerialMessenger messenger;

void setup() {
Serial.begin(115200);
Serial.println("Started!");
messenger.subscribe("Channel1", &channel1);
messenger.subscribe("Channel2", &channel1);
}

void loop() {
messenger.handle();
}

void channel1(String message) {
Serial.println(message);
}
messenger.send("Received", message);
}

0 comments on commit ba67073

Please sign in to comment.