Bradley Kohler
/
FRDM_Pacemaker
a pacemaker
main.cpp@2:ab8469051a2d, 2016-10-26 (annotated)
- Committer:
- kohlerba
- Date:
- Wed Oct 26 14:04:14 2016 +0000
- Revision:
- 2:ab8469051a2d
- Parent:
- 1:446bd28a1f19
- Child:
- 3:334300ac49e5
pacing works with busy loops.
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 | 2:ab8469051a2d | 11 | wait(3); |
kohlerba | 2:ab8469051a2d | 12 | ledb = 1; |
kohlerba | 2:ab8469051a2d | 13 | wait(1); |
kohlerba | 0:9e97accb2a4c | 14 | start_clock(); |
kohlerba | 0:9e97accb2a4c | 15 | while (true) { |
kohlerba | 1:446bd28a1f19 | 16 | pc.printf("%d" , get_time()); |
kohlerba | 1:446bd28a1f19 | 17 | pc.printf("\n"); |
kohlerba | 2:ab8469051a2d | 18 | ledg = 0; |
kohlerba | 1:446bd28a1f19 | 19 | v_pace_sq(5 , 0.08); |
kohlerba | 2:ab8469051a2d | 20 | ledg = 1; |
kohlerba | 1:446bd28a1f19 | 21 | pc.printf("%d" , get_time()); |
kohlerba | 1:446bd28a1f19 | 22 | pc.printf("\n"); |
kohlerba | 1:446bd28a1f19 | 23 | wait(0.92); |
kohlerba | 0:9e97accb2a4c | 24 | } |
kohlerba | 0:9e97accb2a4c | 25 | } |