Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   FXOS8700Q Queue mbed-rtos mbed

Fork of Pacemaker by Eric dollar

hardware.cpp

Committer:
noahzwiep
Date:
2016-11-17
Revision:
16:08d5e5a3ee74
Parent:
10:0e0130742e87
Child:
19:d58e1e1a9a24

File content as of revision 16:08d5e5a3ee74:

#pragma once
#include "hardware.h"
#include "mbed.h"


hardware::hardware(): atrium(PTC12),ventricle(PTC12),pc(USBTX,USBRX),sense(PTB2){
    pc.baud(9600);
    }
    
hardware::~hardware(){};
    
Serial* hardware::getSerial(){
    Serial* p = &pc;
    return p;
}

PwmOut* hardware::getChamber(char chamber){
    if(chamber == 'a'){
        PwmOut* a = &atrium;
        return a;
        }
    else {
        PwmOut* v = &ventricle;
        return v;
    }
}

double hardware::getSense(){
    return sense.read();
}