Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   mbed Queue mbed-rtos FXOS8700Q

Fork of Pacemaker by Eric dollar

SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.

The project uses the Freescale K64F Microcontroller and C++ mbed library.

Committer:
noahzwiep
Date:
Thu Nov 17 04:03:25 2016 +0000
Revision:
16:08d5e5a3ee74
Parent:
10:35b259e70c9a
Child:
19:d58e1e1a9a24
- Made change to hardware class that provides sensing pin; - Made dataStruct class in which there is multiple threading for grabbing queue data; - Made queue in datastruct to allow storage of data

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