This project confirms the use of a header file for data inclusion. It is not standard practice to put array creation code in a header file, but it works. See comments in datafile.h regarding sampling rate, etc.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002   Project: AnalogOutTest
00003   File: main.cpp
00004   Last revised by: Dr. C. S. Tritt
00005   Last revision on: 9/26/17 (v. 1.0)
00006   
00007   Confirms the use of a header file for data inclusion. It is not standard 
00008   practice to put array creation code in a header file, but it works. See 
00009   comments in datafile.h regarding sampling rate, etc.
00010 */
00011 #include "mbed.h"
00012 
00013 // This line incorporates the ECG data into this program. It creates an int 
00014 // array called data_array.
00015 #include <datafile.h> 
00016 
00017 int main(void) {
00018   int aSize = sizeof(data_array)/sizeof(data_array[0]);
00019   printf("Calculated array size: %d.\n", aSize);
00020 }