Cosmic Ray Sheilding

Dependencies:   mbed SDFileSystem ExtendedTimer

main.cpp

Committer:
ccalderon22
Date:
2019-03-21
Revision:
0:600099ef57c8
Child:
1:c7c64242fe4c

File content as of revision 0:600099ef57c8:

#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;
    }
  }
}