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: N5110.cpp
- Revision:
- 8:40abe5736eca
- Parent:
- 7:3010f24e0a81
- Child:
- 9:7701f0126ba7
diff -r 3010f24e0a81 -r 40abe5736eca N5110.cpp
--- a/N5110.cpp Mon May 19 18:23:21 2014 +0000
+++ b/N5110.cpp Mon May 19 18:45:48 2014 +0000
@@ -261,4 +261,21 @@
buffer[i][j]=0;
}
}
+}
+
+// function to plot array on display
+void N5110::plotArray(float array[]) {
+
+ int i;
+
+ for (i=0; i<84; i++) { // loop through array
+ // elements are normalised from 0.0 to 1.0, so multiply
+ // by 47 to convert to pixel range, and subtract from 47
+ // since top-left is 0,0 in the display geometry
+ setPixel(i,47 - (int) array[i]*47.0);
+ }
+
+ refresh();
+
+
}
\ No newline at end of file