OBJECTIVE
- To build program to communicate output of the calculation to notebook for analysis and display the output
PROCEDURE
/*Procedure to send the following data out the serial
communicaitons port */
/* BPM - Heart Rate in Beats per Minute */
/*Procedure to send the following data out the serial
communications port */
/*(IRDiff) - IR Difference between the IRFilt and the IR_DC
signals */
/*(5*dIRFilt) - Output of the High Pass Filter (Differentiator)*/
/*(5*Peak) - Output from the Peak Follower Algorithm*/
void PrintIRDat(void)
{
// sprintf(message,"%d %d
%d\r\n",(int)IRDiff,(int)(5.*dIRFilt),(int)(5.*Peak));
itoa((int)IRDiff,buf,10);
strcpy(message,buf);
strcat(message," ");
itoa((int)(5.*dIRFilt),buf,10);
strcat(message,buf);
strcat(message," ");
itoa((int)(5.*Peak),buf,10);
strcat(message,buf);
strcat(message,"\r\n");
SendString(message);
}- Second part is to send buffered data
/* send the following data out the serial
communicaiton port */
/*(RDat) - Buffered RFilt */
/*(R_DCDat) - Buffered DC signal from the RED Source */
/*(IRDat) - Buffered IRFilt */
/*(IR_DCDat) - Buffered DC signal from the IR Source */
void PrintDat(void)
{
// sprintf(message,"%u %u
%u
%u\r\n",RDat,R_DCDat,IRDat,IR_DCDat);
itoa(RDat,buf,10);
strcpy(message,buf);
strcat(message," ");
itoa(R_DCDat,buf,10);
strcat(message,buf);
strcat(message," ");
itoa(IRDat,buf,10);
strcat(message,buf);
strcat(message," ");
itoa(IR_DCDat,buf,10);
strcat(message,buf);
strcat(message,"\r\n");
SendString(message);
}
- The last part is to send SpO2 wave data
/* SPO2ave - Oxygen Saturation in percent */
void PrintResults(void)
{
itoa(BPM,buf,10);
strcpy(message,buf);
strcat(message," ");
itoa(SPO2ave,buf,10);
strcat(message,buf);
strcat(message,"\r\n");
SendString(message);
}
CONCLUSION
- The communication to serial port is important to analyze the output and calibrate to make sure the output reading can produce stable and repeatable result.
No comments:
Post a Comment