画像を2枚撮影
main.cpp
- Committer:
- MatsumotoKouki
- Date:
- 2019-11-21
- Revision:
- 2:7745e694124f
- Child:
- 3:6462ae80537b
File content as of revision 2:7745e694124f:
#include "mbed.h" #include "JPEGCamera.h" int main() { JPEGCamera camera(p13, p14); // TX, RX LocalFileSystem local("local"); Timer timer; timer.start(); camera.setPictureSize(JPEGCamera::SIZE320x240); for (int i = 0; i < 2; i++) { if (camera.isReady()) { char filename[32]; sprintf(filename, "/local/pict%03d.jpg", i); printf("Picture: %s ", filename); if (camera.takePicture(filename)) { while (camera.isProcessing()) { camera.processPicture(); } } else { printf("take picture failed\n"); } } else { printf("camera is not ready\n"); } } printf("time = %f\n", timer.read()); }