Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   FXOS8700Q Queue mbed-rtos mbed

Fork of Pacemaker by Eric dollar

Committer:
FiveDollar
Date:
Tue Nov 29 21:30:19 2016 +0000
Revision:
30:0cb4890910cd
Parent:
20:bfd23a6845bb
this is the messed up code that i tried to fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
FiveDollar 0:b2b3955cd77b 1 #pragma once
FiveDollar 0:b2b3955cd77b 2 #include "hardware.h"
FiveDollar 0:b2b3955cd77b 3 #include "mbed.h"
FiveDollar 0:b2b3955cd77b 4
trane3 19:d58e1e1a9a24 5 hardware::hardware(): atrium(PTC10),ventricle(PTC11),pc(USBTX,USBRX),sense(PTB2){
FiveDollar 0:b2b3955cd77b 6 pc.baud(9600);
FiveDollar 20:bfd23a6845bb 7 }
FiveDollar 0:b2b3955cd77b 8
FiveDollar 0:b2b3955cd77b 9 hardware::~hardware(){};
FiveDollar 0:b2b3955cd77b 10
FiveDollar 0:b2b3955cd77b 11 Serial* hardware::getSerial(){
FiveDollar 0:b2b3955cd77b 12 Serial* p = &pc;
FiveDollar 0:b2b3955cd77b 13 return p;
FiveDollar 0:b2b3955cd77b 14 }
FiveDollar 0:b2b3955cd77b 15
trane3 5:253c33930e91 16 PwmOut* hardware::getChamber(char chamber){
FiveDollar 0:b2b3955cd77b 17 if(chamber == 'a'){
FiveDollar 1:fbba2687ddfe 18 PwmOut* a = &atrium;
FiveDollar 0:b2b3955cd77b 19 return a;
FiveDollar 0:b2b3955cd77b 20 }
FiveDollar 0:b2b3955cd77b 21 else {
FiveDollar 1:fbba2687ddfe 22 PwmOut* v = &ventricle;
FiveDollar 0:b2b3955cd77b 23 return v;
FiveDollar 0:b2b3955cd77b 24 }
noahzwiep 16:08d5e5a3ee74 25 }
noahzwiep 16:08d5e5a3ee74 26
noahzwiep 16:08d5e5a3ee74 27 double hardware::getSense(){
noahzwiep 16:08d5e5a3ee74 28 return sense.read();
noahzwiep 16:08d5e5a3ee74 29 }