Task 4.3.6 Solution
Fork of Task436Solution by
Diff: main.cpp
- Revision:
- 2:3f65535dbccf
- Parent:
- 0:315c40dcb63f
--- a/main.cpp Thu Jul 13 14:54:37 2017 +0000
+++ b/main.cpp Wed Sep 18 13:56:18 2019 +0000
@@ -39,6 +39,7 @@
//Print header
pc.printf("POT,LDR,avPOT, acLDR\n\n");
+ wait(0.5);
//Set up the ticker - 100Hz
t.attach(doCaptureSamples, 0.01);
@@ -62,6 +63,7 @@
//Write to terminal via Serial interface
int middle = (indexOfOldest - (N/2)) % N;
pc.printf("%6.4f,%6.4f,%6.4f,%6.4f\n", xPOT[middle], xLDR[middle], fPOTSum/(float)N, fLDRSum/(float)N);
+ wait(0.0021); //Allow send time for 30 characters (at 115200 bits / s, 14,400 bytes / s)
//Check the threshold
if (fLDRSum > fPOTSum) {
