Browse code

4 arrays logs per second = 360 in 30 S

dewomser authored on17/12/2019 18:31:53
Showing1 changed files

... ...
@@ -40,10 +40,10 @@ MMA8452Q accel;
40 40
 const int buttonPin = 12;
41 41
 const int ledPin =  13;
42 42
 int buttonState = 0;
43
-float xyz[263];
43
+float xyz[360];
44 44
 int cycle = 0;
45 45
 int cycle1 = 0;
46
-int messungen = 264;
46
+int messungen = 360;
47 47
 
48 48
 
49 49
 // The setup function simply starts serial and initializes the
... ...
@@ -83,7 +83,7 @@ buttonState = digitalRead(buttonPin);
83 83
     digitalWrite(ledPin, HIGH);
84 84
 
85 85
     for (int cycle = 0 ; cycle < messungen; cycle = cycle + 3) {
86
-      delay (100);
86
+      delay (250);
87 87
       
88 88
       //Serial.print (i);
89 89
       //Serial.print("\t");
... ...
@@ -99,7 +99,7 @@ buttonState = digitalRead(buttonPin);
99 99
 
100 100
     }
101 101
     Serial.print ("Daten zu Ende");
102
-    delay(1000);
102
+    // delay(1000);
103 103
     // cycle = 0 ;
104 104
 digitalWrite(ledPin, LOW);
105 105
   } else {
... ...
@@ -170,8 +170,9 @@ void printCalculatedAccels()
170 170
 
171 171
 void printCalculatedAccels()
172 172
 {
173
-  messungen = 250;
173
+  messungen = 357;
174 174
   cycle=cycle + 3;
175
+  delay(250);
175 176
     xyz[cycle] = (accel.cx);
176 177
     //  Serial.print("\t");
177 178
     xyz[cycle + 1] = (accel.cy);
... ...
@@ -183,11 +184,10 @@ Serial.print("\t");
183 184
 Serial.print (xyz[cycle + 1], 3);
184 185
 Serial.print("\t");
185 186
 Serial.print (xyz[cycle + 2], 3);
186
-Serial.print("\t");
187
+// Serial.print("\t");
188
+// Serial.print(cycle);
189
+Serial.print("\n");
187 190
 
188
-    
189
-    Serial.print(cycle);
190
-    Serial.print("\n");
191 191
 if (cycle > messungen){
192 192
   return;
193 193
   }
... ...
@@ -195,6 +195,10 @@ if (cycle > messungen){
195 195
     }
196 196
 
197 197
 
198
+
199
+
200
+
201
+
198 202
 // This function demonstrates how to use the accel.readPL()
199 203
 // function, which reads the portrait/landscape status of the
200 204
 // sensor.