[chronojump] Added get_transmission_format function
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Added get_transmission_format function
- Date: Mon, 18 Feb 2019 16:04:56 +0000 (UTC)
commit 348589f21ea2f5c7f9ac76222dd1d4a449b4d8f3
Author: Xavier Padullés <x padulles gmail com>
Date: Mon Feb 18 16:55:17 2019 +0100
Added get_transmission_format function
arduino/ForceSensor/ForceSensor.ino | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/arduino/ForceSensor/ForceSensor.ino b/arduino/ForceSensor/ForceSensor.ino
index 56a6001a..c2ea700e 100644
--- a/arduino/ForceSensor/ForceSensor.ino
+++ b/arduino/ForceSensor/ForceSensor.ino
@@ -39,7 +39,7 @@
#define CLK 2
//Version number //it always need to start with: "Force_Sensor-"
-String version = "Force_Sensor-0.2";
+String version = "Force_Sensor-0.3";
int tareAddress = 0;
@@ -59,6 +59,9 @@ float weight = 0.0;
//Wether the sensor has to capture or not
boolean capturing = false;
+//wether the tranmission is in binary format or not
+boolean binaryFormat = false;
+
unsigned long lastTime = 0;
unsigned long currentTime = 0;
unsigned long elapsedTime = 0;
@@ -141,6 +144,8 @@ void serialEvent()
set_tare(inputString);
} else if (commandString == "tare"){
tare();
+ } else if (commandString == "get_transmission_format"){
+ get_transmission_format();
} else {
Serial.println("Not a valid command");
}
@@ -231,3 +236,13 @@ String get_command_argument(String inputString)
return(inputString.substring(inputString.lastIndexOf(":") + 1, inputString.lastIndexOf(";")));
}
+void get_transmission_format()
+{
+ if (binaryFormat)
+ {
+ Serial.print("binary");
+ } else
+ {
+ Serial.print("text");
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]