a pacemaker

Dependencies:   mbed

Revision:
3:334300ac49e5
Parent:
1:446bd28a1f19
--- a/v_pacing.cpp	Wed Oct 26 14:04:14 2016 +0000
+++ b/v_pacing.cpp	Wed Oct 26 18:20:43 2016 +0000
@@ -12,11 +12,11 @@
     }
     
 int v_pace_sq(double amp , double pulse_width){
-    assert (get_time() != 0);
-    double clock_freeze = get_time();
-    while((get_time() - clock_freeze) < pulse_width){
-        set_v_pace(amp);
-        }
-    v_pace = 0;
-    return 1;
+        if (get_ventricle_counter() > pulse_width){
+            set_ventricle_logic(0);
+            }
+        else{
+            v_pace = amp;
+            }
+        return 0;
     }