eric's fork test

Dependencies:   mbed

Fork of Pacemaker by 3k04 team

Committer:
FiveDollar
Date:
Sun Oct 30 16:04:52 2016 +0000
Revision:
0:b2b3955cd77b
Child:
2:fbba2687ddfe
Initial Commit

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
FiveDollar 0:b2b3955cd77b 5 AnalogOut atrium(DAC0_OUT);
FiveDollar 0:b2b3955cd77b 6 AnalogOut ventricle(DAC0_OUT);
FiveDollar 0:b2b3955cd77b 7 Serial pc(USBTX,USBRX);
FiveDollar 0:b2b3955cd77b 8
FiveDollar 0:b2b3955cd77b 9
FiveDollar 0:b2b3955cd77b 10 hardware::hardware(): atrium(DAC0_OUT) , ventricle(DAC0_OUT) , pc(USBTX,USBRX){
FiveDollar 0:b2b3955cd77b 11 pc.baud(9600);
FiveDollar 0:b2b3955cd77b 12 }
FiveDollar 0:b2b3955cd77b 13
FiveDollar 0:b2b3955cd77b 14 hardware::~hardware(){};
FiveDollar 0:b2b3955cd77b 15
FiveDollar 0:b2b3955cd77b 16 Serial* hardware::getSerial(){
FiveDollar 0:b2b3955cd77b 17 Serial* p = &pc;
FiveDollar 0:b2b3955cd77b 18 return p;
FiveDollar 0:b2b3955cd77b 19 }
FiveDollar 0:b2b3955cd77b 20
FiveDollar 0:b2b3955cd77b 21 AnalogOut* hardware::getChamber(char chamber){
FiveDollar 0:b2b3955cd77b 22 if(chamber == 'a'){
FiveDollar 0:b2b3955cd77b 23 AnalogOut* a = &atrium;
FiveDollar 0:b2b3955cd77b 24 return a;
FiveDollar 0:b2b3955cd77b 25 }
FiveDollar 0:b2b3955cd77b 26 else {
FiveDollar 0:b2b3955cd77b 27 AnalogOut* v = &ventricle;
FiveDollar 0:b2b3955cd77b 28 return v;
FiveDollar 0:b2b3955cd77b 29 }
FiveDollar 0:b2b3955cd77b 30 }