LinkSprite JPEG Color Camera Test Program.
Dependencies: mbed Camera_LS_Y201 SDFileSystem
Diff: main.cpp
- Revision:
- 0:07895dc2b7c3
- Child:
- 1:71734a321e31
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 25 15:44:19 2010 +0000 @@ -0,0 +1,40 @@ +#include "mbed.h" +#include "Camera_LS_Y201.h" + +LocalFileSystem fs("local"); +Camera_LS_Y201 cam(p13, p14); + +FILE *fp; + +void callback_func(uint8_t *buf, size_t siz) { + fwrite(buf, siz, 1, fp); +} + +int main(void) { + fp = fopen("/local/test.jpg", "wb"); + if (fp == NULL) { + error("Failure to open a destination file."); + } + wait(1); + + printf("reset=%d\n", cam.reset()); + wait(1); + +#if 0 + printf("setImageSize=%d\n", cam.setImageSize(LS_Y201::ImageSize640x480)); + wait(1); +#endif + + printf("takePicture=%d\n", cam.takePicture()); + wait(1); + + int fs; + printf("readJpegFileSize=%d\n", cam.readJpegFileSize(&fs)); + printf("\tFile size = %d\n", fs); + wait(1); + + printf("readJpegFileContent=%d\n", cam.readJpegFileContent(callback_func)); + wait(1); + + return 0; +}