画像を2枚撮影

Revision:
2:7745e694124f
Child:
3:6462ae80537b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 21 13:13:26 2019 +0000
@@ -0,0 +1,28 @@
+#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());
+}
\ No newline at end of file