diff options
Diffstat (limited to 'libraries/Bridge/examples')
-rw-r--r-- | libraries/Bridge/examples/Bridge/Bridge.ino | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/libraries/Bridge/examples/Bridge/Bridge.ino b/libraries/Bridge/examples/Bridge/Bridge.ino index 7318618..df1e069 100644 --- a/libraries/Bridge/examples/Bridge/Bridge.ino +++ b/libraries/Bridge/examples/Bridge/Bridge.ino @@ -90,23 +90,23 @@ void modeCommand(String command) { } void reportPinMode(int pin, String mode) { - String message = "{\"pin\":"; - message += pin; - message += ", \"mode\": \""; - message += mode; - message += "\"}"; - Bridge.writeMessage(message); + String json = "{\"pin\":"; + json += pin; + json += ", \"mode\": \""; + json += mode; + json += "\"}"; + Bridge.writeJSON(json); } void reportDigitalRead(int pin, boolean dataset) { int value = digitalRead(pin); - String message = "{\"pin\":"; - message += pin; - message += ", \"value\": "; - message += value; - message += "}"; - Bridge.writeMessage(message); + String json = "{\"pin\":"; + json += pin; + json += ", \"value\": "; + json += value; + json += "}"; + Bridge.writeJSON(json); if (dataset) { String key = "D"; @@ -118,12 +118,12 @@ void reportDigitalRead(int pin, boolean dataset) { void reportAnalogRead(int pin, boolean dataset) { int value = analogRead(pin); - String message = "{\"pin\":"; - message += pin; - message += ", \"value\": "; - message += value; - message += "}"; - Bridge.writeMessage(message); + String json = "{\"pin\":"; + json += pin; + json += ", \"value\": "; + json += value; + json += "}"; + Bridge.writeJSON(json); if (dataset) { String key = "A"; |