Done

Dependencies:   TextLCD mbed-rtos mbed

Fork of pm_pacemaker by Phil Perilstein

Revision:
1:af9d2597b7e5
Parent:
0:b27d866ee3b3
--- a/main.cpp	Thu Dec 01 03:28:38 2016 +0000
+++ b/main.cpp	Thu Dec 01 04:53:52 2016 +0000
@@ -95,8 +95,8 @@
         Thread::wait(observation_interval * 1000);
         lcd.cls();
         int hr = (heart_beats*60) / (observation_interval);
-        lcd.printf("%s%d%s","HR: ", hr, " bpm");
-
+        lcd.printf("%s%d%s","HR: ", hr, " bpm\n");
+        //lcd.printf("%d", observation_interval);
         switch(mode) {
             case('n'):
                 if (hr > 100) {
@@ -314,14 +314,14 @@
                     mode = 'n';
                     upperBound = 100; //beats per msecond
                     lowerBound = 40; //beats per msecond
-                    lcd.printf("N");
+                    //lcd.printf("N");
                     initialize_intervals();
                     break;
                 case('s'):
                     mode = 's';
                     upperBound = 60; //beats per msecond
                     lowerBound = 30; //beats per msecond v-v 0.5s
-                    lcd.printf("S");
+                    //lcd.printf("S");
                     ratio = (60.00/100.00 + 30.00/40.00) / 2.00;
                     initialize_intervals();
                     LRI /= ratio;
@@ -336,7 +336,7 @@
                     mode = 'e';
                     upperBound = 175; //beats per msecond
                     lowerBound = 100; //beats per msecond
-                    lcd.printf("E");
+                    //lcd.printf("E");
                     ratio = (175.00/100.00 + 100.00/40.00) / 2.00;
                     initialize_intervals();
                     LRI /= ratio;
@@ -351,16 +351,15 @@
                     mode = 'm';
                     upperBound = 175; //beats per msecond
                     lowerBound = 30; //beats per msecond
-                    lcd.printf("M");
+                    //lcd.printf("M");
 //                    LRI = 1000;
 //                    URI = 700;
 //                    PVARP = 300;
                     manual_mode = 1;
                     break;
                 case('o'):
-
                     isChangingObsInt = 1;
-                    lcd.printf("O");
+                    //lcd.printf("O");
                     break;
             }
 ///////manual pacing
@@ -385,15 +384,15 @@
 //                lcd.printf("0");
                 if(key != '\r' && (int)key > 47 && (int)key < 58) {
                     //use atoi - asci to integer to convert input key to 0 - 10
-                    newObsInt[i] += key;
+                    newObsInt[i] = key;
                     i++;
-                    lcd.printf("1");
+                    //lcd.printf("1");
                 } else if(key == '\r') {
                     newObsInt[i] = '\0';
                     int obsint;
                     sscanf(newObsInt, "%d", &obsint);
-                    observation_interval = obsint * 1000;
-                    lcd.printf("%s", obsint);
+                    observation_interval = obsint;
+                    //lcd.printf("%d", observation_interval);
                     isChangingObsInt = 0;
                 }
             }