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:d49bf1a75d35
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Aug 22 10:14:05 2015 +0000
@@ -0,0 +1,47 @@
+#include "mbed.h"
+#include "JPEGCamera.h"
+Serial pc(USBTX,USBRX);
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+DigitalOut signalPin(p25);
+char diff;
+int main()
+{
+ pc.baud(9600);
+ JPEGCamera camera(p9, p10); // TX, RX
+ LocalFileSystem local("local");
+ Timer timer;
+ timer.start();
+ pc.printf("Setting SIZE 160X120");
+ camera.setPictureSize(JPEGCamera::SIZE160x120);
+ pc.printf("\nSetting SIZE 160X120 done and Taking reference image\n");
+ int i=4;
+ while(i--){
+ if (camera.isReady())
+ {
+ char filename[32];
+ sprintf(filename, "/local/image%d.jpg",i);
+ pc.printf("Picture: %s \r\n", filename);
+ if (camera.takePicture(filename))
+ {while (camera.isProcessing()) camera.processPicture();
+ } else pc.printf("take picture failed\n");
+ } else pc.printf("camera is not ready\n");
+ wait(0.5);
+ }
+ //pc.printf("Took IMG_REF\r\n");
+
+ /*while(pc.readable()==0 && signalPin==0){
+ if (camera.isReady())
+ { char filename[32];
+ sprintf(filename, "/local/PICT.jpg");
+ pc.printf("Picture: %s \r\n", filename);
+ if (camera.takePicture(filename))
+ {while (camera.isProcessing()) camera.processPicture();
+ } else pc.printf("take picture failed\n");
+ }else pc.printf("camera is not ready\n");
+ */
+ pc.printf("Took PICT\r\n");
+ //signalPin=1;}
+}
\ No newline at end of file