Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   mbed Queue mbed-rtos FXOS8700Q

Fork of Pacemaker by Eric dollar

SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.

The project uses the Freescale K64F Microcontroller and C++ mbed library.

Committer:
noahzwiep
Date:
Tue Dec 13 04:34:36 2016 +0000
Revision:
35:fa164704f0ca
Parent:
34:701503855d52
Child:
36:b6431cd8ecd6
Added markers for egram; Still need to figure out shield

Who changed what in which revision?

UserRevisionLine numberNew contents of line
noahzwiep 33:686a1a0c690f 1 #include "rtos.h"
noahzwiep 33:686a1a0c690f 2 #include "mbed.h"
noahzwiep 33:686a1a0c690f 3 #include "hardware.h"
noahzwiep 33:686a1a0c690f 4 #include "pulse.h"
noahzwiep 33:686a1a0c690f 5 #include "chamberData.h"
noahzwiep 33:686a1a0c690f 6 #include "pulse.h"
noahzwiep 33:686a1a0c690f 7 #include "VVI.h"
noahzwiep 34:701503855d52 8 #include "sense.h"
noahzwiep 33:686a1a0c690f 9
noahzwiep 33:686a1a0c690f 10
noahzwiep 33:686a1a0c690f 11 DigitalOut green(LED_GREEN);
noahzwiep 33:686a1a0c690f 12
noahzwiep 34:701503855d52 13 pulse* chamberPulse;
noahzwiep 34:701503855d52 14 chamberData* myChamber;
noahzwiep 34:701503855d52 15 sense* mySense;
noahzwiep 33:686a1a0c690f 16
noahzwiep 34:701503855d52 17 void vvi_set_chamber(pulse* c, chamberData* d, sense* e){
noahzwiep 34:701503855d52 18 chamberPulse = c;
noahzwiep 34:701503855d52 19 myChamber = d;
noahzwiep 34:701503855d52 20 mySense = e;
noahzwiep 33:686a1a0c690f 21 }
noahzwiep 33:686a1a0c690f 22
noahzwiep 33:686a1a0c690f 23 void start_VVI(){
noahzwiep 33:686a1a0c690f 24 while(true){
noahzwiep 33:686a1a0c690f 25 green = !green;
noahzwiep 35:fa164704f0ca 26 myChamber->setMarker('x');
noahzwiep 34:701503855d52 27 bool sensed = mySense->returnedSense();
noahzwiep 34:701503855d52 28 if(!sensed){
noahzwiep 34:701503855d52 29 chamberPulse->startPulse();
noahzwiep 35:fa164704f0ca 30 myChamber->setMarker('p');
noahzwiep 35:fa164704f0ca 31 }
noahzwiep 35:fa164704f0ca 32 else{
noahzwiep 35:fa164704f0ca 33 myChamber->setMarker('s');
noahzwiep 34:701503855d52 34 }
noahzwiep 34:701503855d52 35 Thread::wait(myChamber->getRP());
noahzwiep 33:686a1a0c690f 36 }
noahzwiep 33:686a1a0c690f 37 }
noahzwiep 33:686a1a0c690f 38