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.
Dependencies: mbed
Revision 0:ff18c8dc7227, committed 2018-04-18
- Comitter:
- ELCT302Honors
- Date:
- Wed Apr 18 20:37:15 2018 +0000
- Child:
- 1:6dafc578e9f4
- Commit message:
- working line scan camera;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Apr 18 20:37:15 2018 +0000
@@ -0,0 +1,62 @@
+#include "mbed.h"
+
+
+AnalogIn cameraIn1(PTB0);
+DigitalOut si(PTA12);
+DigitalOut clk(PTD4);
+Serial bt(PTE0, PTE1);
+
+int sensorVal = 0;
+
+
+float PixArray[128];
+
+
+
+int main() {
+
+ bt.baud(115200);
+
+//Initialize -- Clocks out indeterminate pixel data from power up
+ si.write(1);
+ clk.write(1);
+ si.write(0);
+ clk.write(0);
+
+ for (int i = 0; i< 128; i++)
+ {
+ clk.write(1);
+ clk.write(0);
+ }
+//End Initialization
+
+
+ while(1)
+ {
+ sensorVal = cameraIn1.read();
+
+ //Start pixel count
+ si.write(1);
+ clk.write(1);
+ si.write(0);
+ clk.write(0);
+
+ //Pixel Count and read
+ for (int i = 0; i <128; i++)
+ {
+ wait_us(50); //saturation time
+ PixArray[i] = cameraIn1.read();
+ clk.write(1);
+ clk.write(0);
+ }
+
+
+ for(int i = 0; i < 128; i++)
+ {
+ bt.printf("%f,", PixArray[i]);
+ }
+ bt.printf("\r\n");
+
+
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Apr 18 20:37:15 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/994bdf8177cb \ No newline at end of file