Cosmic Ray Sheilding

Dependencies:   mbed SDFileSystem ExtendedTimer

Revision:
0:600099ef57c8
Child:
1:c7c64242fe4c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Mar 21 17:31:29 2019 +0000
@@ -0,0 +1,30 @@
+#include <mbed.h>
+
+InterruptIn geigerDelrin(p13); //Counter Serial Number:101
+InterruptIn geigerJello(p14); //Counter Serial Number:142
+Serial pc (USBTX, USBRX);
+Timer readPulse;
+bool timeToRead;
+
+void countDelrinPulse(void); //Function called when Delrin Geiger reads pulse
+void countJelloPulse(void); //Function called when Jello Geiger reads pulse
+
+int jelloCount = 0;
+int delrinCount = 0;
+
+int main() {
+  geigerDelrin.fall(&countDelrinPulse); //Geiger counter reads a hit
+  geigerJello.fall(&countJelloPulse);
+
+  readPulse.start();
+
+  while (true){
+    if (readPulse > 60){ //Displays number of counts per 15 seconds
+      readPulse.reset();
+      pc.printf("Delrin Count: %d \r\n", jelloCount);
+      pc.printf("Jello Count: %d \r\n", delrinCount);
+      jelloCount = 0;
+      delrinCount = 0;
+    }
+  }
+}
\ No newline at end of file