Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #define smp 2778 //2778 or 10000 00003 #define ecgsize 3600 //1000 or 7200 00004 00005 LocalFileSystem local("local"); 00006 AnalogOut analog_out(p18); 00007 PwmOut pwm_out(LED2); 00008 00009 int main() { 00010 float sample[ecgsize]; 00011 FILE *fp = fopen("/local/data.txt","r"); // ECG_n 00012 for (int i = 0; i < ecgsize; i++) { 00013 // 7200 or 1000 00014 fscanf(fp, "%f", &sample[i]); 00015 } 00016 fclose(fp); 00017 00018 for (;;) { 00019 for (int i = 0; i < ecgsize; i++) { 00020 analog_out.write(sample[i]); 00021 pwm_out = sample[i]; 00022 wait_us(smp); 00023 } 00024 } 00025 }
Generated on Wed Aug 3 2022 21:35:03 by
1.7.2