Pacemaker code Implementation for SFWRENG 3K04
Dependencies: mbed Queue mbed-rtos FXOS8700Q
Fork of Pacemaker by
SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.
The project uses the Freescale K64F Microcontroller and C++ mbed library.
hardware.cpp@20:bfd23a6845bb, 2016-11-24 (annotated)
- Committer:
- FiveDollar
- Date:
- Thu Nov 24 03:26:14 2016 +0000
- Revision:
- 20:bfd23a6845bb
- Parent:
- 19:d58e1e1a9a24
All values can now be updated
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
FiveDollar | 0:b2b3955cd77b | 1 | #pragma once |
FiveDollar | 0:b2b3955cd77b | 2 | #include "hardware.h" |
FiveDollar | 0:b2b3955cd77b | 3 | #include "mbed.h" |
FiveDollar | 0:b2b3955cd77b | 4 | |
trane3 | 19:d58e1e1a9a24 | 5 | hardware::hardware(): atrium(PTC10),ventricle(PTC11),pc(USBTX,USBRX),sense(PTB2){ |
FiveDollar | 0:b2b3955cd77b | 6 | pc.baud(9600); |
FiveDollar | 20:bfd23a6845bb | 7 | } |
FiveDollar | 0:b2b3955cd77b | 8 | |
FiveDollar | 0:b2b3955cd77b | 9 | hardware::~hardware(){}; |
FiveDollar | 0:b2b3955cd77b | 10 | |
FiveDollar | 0:b2b3955cd77b | 11 | Serial* hardware::getSerial(){ |
FiveDollar | 0:b2b3955cd77b | 12 | Serial* p = &pc; |
FiveDollar | 0:b2b3955cd77b | 13 | return p; |
FiveDollar | 0:b2b3955cd77b | 14 | } |
FiveDollar | 0:b2b3955cd77b | 15 | |
trane3 | 5:253c33930e91 | 16 | PwmOut* hardware::getChamber(char chamber){ |
FiveDollar | 0:b2b3955cd77b | 17 | if(chamber == 'a'){ |
FiveDollar | 2:fbba2687ddfe | 18 | PwmOut* a = &atrium; |
FiveDollar | 0:b2b3955cd77b | 19 | return a; |
FiveDollar | 0:b2b3955cd77b | 20 | } |
FiveDollar | 0:b2b3955cd77b | 21 | else { |
FiveDollar | 2:fbba2687ddfe | 22 | PwmOut* v = &ventricle; |
FiveDollar | 0:b2b3955cd77b | 23 | return v; |
FiveDollar | 0:b2b3955cd77b | 24 | } |
noahzwiep | 16:08d5e5a3ee74 | 25 | } |
noahzwiep | 16:08d5e5a3ee74 | 26 | |
noahzwiep | 16:08d5e5a3ee74 | 27 | double hardware::getSense(){ |
noahzwiep | 16:08d5e5a3ee74 | 28 | return sense.read(); |
noahzwiep | 16:08d5e5a3ee74 | 29 | } |