eric's fork test

Dependencies:   mbed-rtos mbed

Fork of Pacemaker by 3k04 team

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pulse.cpp Source File

pulse.cpp

00001 #pragma once
00002 #include "mbed.h"
00003 #include "pulse.h"
00004 #include "rtos.h"
00005 
00006 pulse::pulse(){}
00007     
00008 pulse::pulse(chamberData* chamber, hardware* IOpins){
00009     myIOpins = IOpins;
00010     myChamber = chamber;
00011 //    myPaceWidth = 0; //mSec, width of ventricular pace
00012 //    myPaceAmp = 0; //mV, amplitude of ventricular pace
00013 //    myRP = 0; //mSec, duration of refractory period
00014 //    p_hysteresisInterval = 0;
00015 //    p_lowrateInterval = 0;
00016 //    p_hysteresis = false;
00017     
00018 }
00019 
00020 pulse::~pulse(){
00021     delete myChamber;
00022     delete myIOpins;
00023     delete pc;
00024     delete aOut;
00025 }
00026 
00027 void pulse::setChamber(chamberData* c){
00028     myChamber = c;
00029     }
00030       
00031 
00032 void pulse::startPulse(){
00033    // while(true){
00034         pc = myIOpins->getSerial();  
00035         aOut = myIOpins->getChamber(myChamber->getChamberType());
00036         aOut->write(myChamber->getPaceAmp());    
00037         wait(myChamber->getPaceWidth());
00038         aOut->write(0);
00039         
00040         pc->printf("\nPulsing...check your oscilloscope!");
00041        // wait(myChamber->getPaceWidth());
00042         
00043        // }
00044 }
00045