カメラ 撮影のみ

Dependencies:   mbed JPEGCamera

Committer:
seijakunouenimutou
Date:
Fri Nov 15 13:19:09 2019 +0000
Revision:
2:b7411087c261
Parent:
1:a9210ea335cb
jpeg camera

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yamaguch 0:8399d5434f4f 1 #include "mbed.h"
yamaguch 0:8399d5434f4f 2 #include "JPEGCamera.h"
yamaguch 0:8399d5434f4f 3
yamaguch 0:8399d5434f4f 4 int main() {
seijakunouenimutou 1:a9210ea335cb 5 JPEGCamera camera(p9, p10); // TX, RX
yamaguch 0:8399d5434f4f 6 LocalFileSystem local("local");
yamaguch 0:8399d5434f4f 7 Timer timer;
yamaguch 0:8399d5434f4f 8 timer.start();
yamaguch 0:8399d5434f4f 9 camera.setPictureSize(JPEGCamera::SIZE320x240);
yamaguch 0:8399d5434f4f 10
seijakunouenimutou 1:a9210ea335cb 11 for (int i = 0; i < 1; i++) {
yamaguch 0:8399d5434f4f 12 if (camera.isReady()) {
yamaguch 0:8399d5434f4f 13 char filename[32];
seijakunouenimutou 2:b7411087c261 14 sprintf(filename, "/local/pict%03d.jpg",i);
yamaguch 0:8399d5434f4f 15 printf("Picture: %s ", filename);
yamaguch 0:8399d5434f4f 16 if (camera.takePicture(filename)) {
yamaguch 0:8399d5434f4f 17 while (camera.isProcessing()) {
yamaguch 0:8399d5434f4f 18 camera.processPicture();
yamaguch 0:8399d5434f4f 19 }
yamaguch 0:8399d5434f4f 20 } else {
seijakunouenimutou 1:a9210ea335cb 21 printf("take picture failed\r\n");
yamaguch 0:8399d5434f4f 22 }
yamaguch 0:8399d5434f4f 23 } else {
seijakunouenimutou 1:a9210ea335cb 24 printf("camera is not ready\r\n");
yamaguch 0:8399d5434f4f 25 }
yamaguch 0:8399d5434f4f 26 }
yamaguch 0:8399d5434f4f 27 printf("time = %f\n", timer.read());
yamaguch 0:8399d5434f4f 28 }