![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Part of the Pacemaker Project; this models the Pacemaker.
Dependencies: mbed TextLCD mbed-rtos
Diff: PacemakerController.cpp
- Revision:
- 42:2e4ed3a53c64
- Parent:
- 41:d806d68f7969
- Parent:
- 40:e401b1cb71c0
- Child:
- 43:f28bc869321e
--- a/PacemakerController.cpp Wed Dec 02 05:19:41 2015 +0000 +++ b/PacemakerController.cpp Wed Dec 02 05:31:09 2015 +0000 @@ -19,10 +19,10 @@ Timer avi_clk; Timer t_count; -int LRI = 1000; -int AVI = 150; -int PVARP = 300; -int VRP = 200; +int LRI = 100; +int AVI = 30; +int PVARP = 150; +int VRP = 100; // constants int MAX_PM_RT = 180; @@ -208,7 +208,6 @@ led_vpace = 1; t_count.reset(); - pc.printf("in pmresponse 2"); vpace(); } } else if (t_count.read_ms() < LRI - AVI) { @@ -295,35 +294,41 @@ // if the char is N, update bounds to normal mode curr_mode = NORMAL; upper_bound = 100; + LRI = 100; lower_bound = 40; pc.printf("MODE IS N\n"); // if the char is S, set bounds to sleep } else if (a == 'S') { curr_mode = SLEEP; upper_bound = 60; + LRI = 60; lower_bound = 30; pc.printf("MODE IS S\n"); // if the char is E, set bounds to exercise } else if (a == 'E') { curr_mode = EXERCISE; upper_bound = 175; + LRI = 175; lower_bound = 100; pc.printf("MODE IS E\n"); // if the char is M, set to manual } else if (a == 'M') { curr_mode = MANUAL; upper_bound = 175; + LRI = 175; lower_bound = 30; pc.printf("MODE IS MANUAL\n"); // check for A if mode is manual } else if (a == 'A') { if(curr_mode == MANUAL) { - pc.printf("MODE IS MANUAL GOT APACE\n"); + apace(); + pc.printf("MODE IS MANUAL SENT APACE\n"); } // check for V is mode is manual } else if (a == 'V') { if(curr_mode == MANUAL) { - pc.printf("MODE IS MANUAL GOT VPACE\n"); + vpace(); + pc.printf("MODE IS MANUAL SENT VPACE\n"); } } else if (a == 'O') { keyboard_needs_numeric = 1;