Bradley Kohler
/
FRDM_Pacemaker
a pacemaker
main.cpp@3:334300ac49e5, 2016-10-26 (annotated)
- Committer:
- kohlerba
- Date:
- Wed Oct 26 18:20:43 2016 +0000
- Revision:
- 3:334300ac49e5
- Parent:
- 2:ab8469051a2d
Changed the functions and modules.;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kohlerba | 1:446bd28a1f19 | 1 | #include "main.h" |
kohlerba | 0:9e97accb2a4c | 2 | |
kohlerba | 1:446bd28a1f19 | 3 | Serial pc(USBTX , USBRX); |
kohlerba | 2:ab8469051a2d | 4 | DigitalOut ledg(LED_GREEN); |
kohlerba | 2:ab8469051a2d | 5 | DigitalOut ledb(LED_BLUE); |
kohlerba | 0:9e97accb2a4c | 6 | int main() |
kohlerba | 0:9e97accb2a4c | 7 | { |
kohlerba | 2:ab8469051a2d | 8 | ledb = 0; |
kohlerba | 1:446bd28a1f19 | 9 | pc.printf("connecting..."); |
kohlerba | 1:446bd28a1f19 | 10 | pc.printf("\n\n"); |
kohlerba | 3:334300ac49e5 | 11 | start_clock(); |
kohlerba | 2:ab8469051a2d | 12 | wait(3); |
kohlerba | 2:ab8469051a2d | 13 | ledb = 1; |
kohlerba | 2:ab8469051a2d | 14 | wait(1); |
kohlerba | 0:9e97accb2a4c | 15 | while (true) { |
kohlerba | 3:334300ac49e5 | 16 | pc.printf("%2.4f" , get_time()); |
kohlerba | 1:446bd28a1f19 | 17 | pc.printf("\n"); |
kohlerba | 3:334300ac49e5 | 18 | set_ventricle_logic(1); |
kohlerba | 3:334300ac49e5 | 19 | while (true){ |
kohlerba | 3:334300ac49e5 | 20 | v_pace_sq(34.2 , 0.08); |
kohlerba | 3:334300ac49e5 | 21 | ledg = 0; |
kohlerba | 3:334300ac49e5 | 22 | if (get_ventricle_logic() == 0){ |
kohlerba | 3:334300ac49e5 | 23 | ledg = 1; |
kohlerba | 3:334300ac49e5 | 24 | break; |
kohlerba | 3:334300ac49e5 | 25 | } |
kohlerba | 3:334300ac49e5 | 26 | wait(0.01); |
kohlerba | 3:334300ac49e5 | 27 | } |
kohlerba | 1:446bd28a1f19 | 28 | wait(0.92); |
kohlerba | 0:9e97accb2a4c | 29 | } |
kohlerba | 0:9e97accb2a4c | 30 | } |