![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
array size
main.cpp
- Committer:
- rockstar
- Date:
- 2015-08-22
- Revision:
- 0:d49bf1a75d35
File content as of revision 0:d49bf1a75d35:
#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;} }