From 95a469ae4a675d427d0c00e85ba67f3a45e13df4 Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Sun, 28 Feb 2016 22:43:18 +0100 Subject: [PATCH] improved protocol --- arduino/src/sketch.ino | 8 ++++---- nodejs/ar-com/ir.js | 2 +- nodejs/ar-com/sensor.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arduino/src/sketch.ino b/arduino/src/sketch.ino index 3ba9f0b..bfacee3 100644 --- a/arduino/src/sketch.ino +++ b/arduino/src/sketch.ino @@ -119,7 +119,7 @@ void digitalR(int pin) { pinMode(pin, INPUT); int digraw = digitalRead(pin); Serial.print(pin); - Serial.print('::'); + Serial.print('-'); Serial.println(digraw); } @@ -143,7 +143,7 @@ void analogR(int pin) { pinMode(pin, INPUT); int rval = analogRead(pin); Serial.print(pin); - Serial.print("::"); + Serial.print('-'); Serial.println(rval); } @@ -229,9 +229,9 @@ void irRead(decode_results *results) { unsigned long codeValue = results->value; int codeLen = results->bits; Serial.print(codeType); - Serial.print('::'); + Serial.print('-'); Serial.print(codeLen); - Serial.print('::'); + Serial.print('-'); Serial.println(codeValue); } } diff --git a/nodejs/ar-com/ir.js b/nodejs/ar-com/ir.js index 6b025e6..4ee5fd1 100644 --- a/nodejs/ar-com/ir.js +++ b/nodejs/ar-com/ir.js @@ -6,7 +6,7 @@ var IR = function (arduino) { this.arduino = arduino; this.arduino.on('data', function (message) { - var m = message.slice(0, -1).split('::'), + var m = message.slice(0, -1).split('-'), err = null; if (m.length != 3) { diff --git a/nodejs/ar-com/sensor.js b/nodejs/ar-com/sensor.js index 4f8d680..a83e209 100644 --- a/nodejs/ar-com/sensor.js +++ b/nodejs/ar-com/sensor.js @@ -7,7 +7,7 @@ var Sensor = function (arduino, pin) { this.pin = pin; this.arduino.on('data', function (message) { - var m = message.slice(0, -1).split('::'), + var m = message.slice(0, -1).split('-'), err = null; if (m.length != 2 && this.pin != m[0]) {