Cosmic Ray Sheilding

Dependencies:   mbed SDFileSystem ExtendedTimer

Committer:
lwells
Date:
Thu Mar 21 17:45:42 2019 +0000
Revision:
3:466fdc08e0cd
Parent:
2:2c78fc509a01
Child:
4:66eb0ab160b5
Debugged

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ccalderon22 0:600099ef57c8 1 #include <mbed.h>
ccalderon22 0:600099ef57c8 2
ccalderon22 0:600099ef57c8 3 InterruptIn geigerDelrin(p13); //Counter Serial Number:101
ccalderon22 0:600099ef57c8 4 InterruptIn geigerJello(p14); //Counter Serial Number:142
ccalderon22 0:600099ef57c8 5 Serial pc (USBTX, USBRX);
ccalderon22 0:600099ef57c8 6 Timer readPulse;
ccalderon22 0:600099ef57c8 7
ccalderon22 0:600099ef57c8 8 void countDelrinPulse(void); //Function called when Delrin Geiger reads pulse
ccalderon22 0:600099ef57c8 9 void countJelloPulse(void); //Function called when Jello Geiger reads pulse
ccalderon22 0:600099ef57c8 10
ccalderon22 0:600099ef57c8 11 int jelloCount = 0;
ccalderon22 0:600099ef57c8 12 int delrinCount = 0;
ccalderon22 0:600099ef57c8 13
ccalderon22 0:600099ef57c8 14 int main() {
ccalderon22 0:600099ef57c8 15 geigerDelrin.fall(&countDelrinPulse); //Geiger counter reads a hit
ccalderon22 0:600099ef57c8 16 geigerJello.fall(&countJelloPulse);
ccalderon22 0:600099ef57c8 17
ccalderon22 0:600099ef57c8 18 readPulse.start();
ccalderon22 0:600099ef57c8 19
ccalderon22 0:600099ef57c8 20 while (true){
ccalderon22 0:600099ef57c8 21 if (readPulse > 60){ //Displays number of counts per 15 seconds
ccalderon22 0:600099ef57c8 22 readPulse.reset();
ccalderon22 0:600099ef57c8 23 pc.printf("Delrin Count: %d \r\n", jelloCount);
ccalderon22 0:600099ef57c8 24 pc.printf("Jello Count: %d \r\n", delrinCount);
ccalderon22 0:600099ef57c8 25 jelloCount = 0;
ccalderon22 0:600099ef57c8 26 delrinCount = 0;
ccalderon22 0:600099ef57c8 27 }
ccalderon22 0:600099ef57c8 28 }
lwells 2:2c78fc509a01 29 }
lwells 2:2c78fc509a01 30
lwells 3:466fdc08e0cd 31 void countDelrinPulse(void){
lwells 2:2c78fc509a01 32 delrinCount++;
lwells 2:2c78fc509a01 33 }
lwells 2:2c78fc509a01 34
lwells 3:466fdc08e0cd 35 void countJelloPulse(void){
lwells 3:466fdc08e0cd 36 jelloCount++;
ccalderon22 0:600099ef57c8 37 }