eric's fork test

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