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.
Diff: main.cpp
- Revision:
- 0:1f686b5b74a0
diff -r 000000000000 -r 1f686b5b74a0 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Sep 25 03:24:20 2010 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#define smp 2778 //2778 or 10000
+#define ecgsize 3600 //1000 or 7200
+
+LocalFileSystem local("local");
+AnalogOut analog_out(p18);
+PwmOut pwm_out(LED2);
+
+int main() {
+ float sample[ecgsize];
+ FILE *fp = fopen("/local/data.txt","r"); // ECG_n
+ for (int i = 0; i < ecgsize; i++) {
+ // 7200 or 1000
+ fscanf(fp, "%f", &sample[i]);
+ }
+ fclose(fp);
+
+ for (;;) {
+ for (int i = 0; i < ecgsize; i++) {
+ analog_out.write(sample[i]);
+ pwm_out = sample[i];
+ wait_us(smp);
+ }
+ }
+}