[chronojump] Improvements on two force sensor arduino files



commit 0ea22d2be8e05553aba929778a8d58bd46787894
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jan 7 13:35:44 2019 +0100

    Improvements on two force sensor arduino files

 arduino/ForceSensor4Binary/ForceSensor4Binary.ino     |  2 +-
 arduino/ForceSensorSimulator/ForceSensorSimulator.ino | 12 +++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/arduino/ForceSensor4Binary/ForceSensor4Binary.ino 
b/arduino/ForceSensor4Binary/ForceSensor4Binary.ino
index 1d6d61d2..5f312dcf 100644
--- a/arduino/ForceSensor4Binary/ForceSensor4Binary.ino
+++ b/arduino/ForceSensor4Binary/ForceSensor4Binary.ino
@@ -189,7 +189,7 @@ void serialEvent()
 
 void start_capture()
 {
-  //Serial.println("Starting capture...");
+  Serial.println("Starting capture...");
   totalTime = 0;
   lastTime = micros();
   capturing = true;
diff --git a/arduino/ForceSensorSimulator/ForceSensorSimulator.ino 
b/arduino/ForceSensorSimulator/ForceSensorSimulator.ino
index d74353a0..7ac09a4c 100644
--- a/arduino/ForceSensorSimulator/ForceSensorSimulator.ino
+++ b/arduino/ForceSensorSimulator/ForceSensorSimulator.ino
@@ -37,8 +37,6 @@ unsigned long totalTime = 0;
 //Wether the sensor has to capture or not
 boolean capturing = false;
 
-int current;
-
 void setup(void)
 {
 
@@ -62,7 +60,7 @@ void loop(void)
     //sendLong(initSymbol); //sembla que abans dels 4 255 aixo envia 2 bytes que no son 255, o aquests 2 
bytes van al final dels 4 del for
     //sendLong(micros());
 
-    int current = 0;
+    int currentSimulatedValue = 0;
 
     for (int i = 0; i < 100; i++)
     {
@@ -93,10 +91,10 @@ void loop(void)
       lastTime = currentTime;
       sendLong(totalTime);
 
-      sendInt(current++);
-      sendInt(current++);
-      sendInt(current++);
-      sendInt(current++);
+      sendInt(currentSimulatedValue ++);
+      sendInt(currentSimulatedValue ++);
+      sendInt(currentSimulatedValue ++);
+      sendInt(currentSimulatedValue ++);
     }
   }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]