Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   FXOS8700Q Queue mbed-rtos mbed

Fork of Pacemaker by Eric dollar

Revision:
0:b2b3955cd77b
Child:
1: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;
+    }
+}