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.
Diff: hardware.cpp
- Revision:
- 0:b2b3955cd77b
- Child:
- 2:fbba2687ddfe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hardware.cpp Sun Oct 30 16:04:52 2016 +0000 @@ -0,0 +1,30 @@ +#pragma once +#include "hardware.h" +#include "mbed.h" + +AnalogOut atrium(DAC0_OUT); +AnalogOut ventricle(DAC0_OUT); +Serial pc(USBTX,USBRX); + + +hardware::hardware(): atrium(DAC0_OUT) , ventricle(DAC0_OUT) , pc(USBTX,USBRX){ + pc.baud(9600); + } + +hardware::~hardware(){}; + +Serial* hardware::getSerial(){ + Serial* p = &pc; + return p; +} + +AnalogOut* hardware::getChamber(char chamber){ + if(chamber == 'a'){ + AnalogOut* a = &atrium; + return a; + } + else { + AnalogOut* v = &ventricle; + return v; + } +}