a pacemaker

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
kohlerba
Date:
Wed Oct 26 02:06:02 2016 +0000
Child:
1:446bd28a1f19
Commit message:
You took my pencil!!!!!!!!!!!!!!!!!!

Changed in this revision

clock.cpp Show annotated file Show diff for this revision Revisions of this file
clock.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
main.h Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
pacing.c Show annotated file Show diff for this revision Revisions of this file
pacing.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/clock.cpp	Wed Oct 26 02:06:02 2016 +0000
@@ -0,0 +1,17 @@
+#include "clock.h"
+
+Ticker tick;
+double counter = 0;
+
+void start_clock(void){
+    tick.attach(&count_time, 0.0001);
+    }
+    
+void count_time(void){
+    counter += 0.0001;
+    }
+    
+double get_time(void){
+    return counter;
+    }
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/clock.h	Wed Oct 26 02:06:02 2016 +0000
@@ -0,0 +1,5 @@
+#include "mbed.h"
+
+void start_clock(void);
+void count_time(void);
+double get_time(void);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Oct 26 02:06:02 2016 +0000
@@ -0,0 +1,28 @@
+#include "clock.h"
+Serial pc(USBTX , USBRX);
+
+//DigitalOut gpo(D0);
+//DigitalOut led(LED_RED);
+//
+//
+//Ticker tick;
+//
+//enum chamber {atrial = 'a', ventricle = 'v' , dual = 'd'};
+//
+//double counter;
+//    
+//int generate_sq_wave(int amp ,int freq);
+//void count_time(void);
+//
+//void count_time(void){
+//    counter += 0.0001;
+//    }
+//    
+int main()
+{
+    start_clock();
+    while (true) {
+        pc.printf("%2.4f" , get_time());
+        wait(0.5);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Oct 26 02:06:02 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pacing.c	Wed Oct 26 02:06:02 2016 +0000
@@ -0,0 +1,7 @@
+#include "pacing.h"
+
+void write_to_pin(DigitalOut pinName , int to_write){
+        DigitalOut *pin = new DigitalOut(pinName);
+        pin = to_write;
+    }
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pacing.h	Wed Oct 26 02:06:02 2016 +0000
@@ -0,0 +1,3 @@
+#include "clock.h"
+
+void write_to_pin(DigitalOut& pin ,int to_write);