Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   mbed Queue mbed-rtos FXOS8700Q

Fork of Pacemaker by Eric dollar

SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.

The project uses the Freescale K64F Microcontroller and C++ mbed library.

Revision:
36:b6431cd8ecd6
Parent:
34:701503855d52
diff -r fa164704f0ca -r b6431cd8ecd6 sense.cpp
--- a/sense.cpp	Tue Dec 13 04:34:36 2016 +0000
+++ b/sense.cpp	Sun Dec 18 02:29:59 2016 +0000
@@ -3,7 +3,7 @@
 #include "sense.h"
 #include "VVI.h"
 
-sense::sense(genData* a){
+sense::sense(genData* a): mySense(PTB2){
     myGenData = a; 
     isSensed = false; 
     }
@@ -12,6 +12,7 @@
 
 bool sense::returnedSense(){
     timeout = false;
+    isSensed = false;
     mbed::Timer t;
     t.start();
     while(!timeout){
@@ -27,10 +28,10 @@
             }
         }
         //Here we have to check the pin and see if it is above threshold. 
-/*        if(PINNAME.read() == 1){
+        if(mySense.read() > 0.995){
             isSensed = true;
             timeout = true;
-        }*/
+        }
     }
     t.stop();
     return isSensed;