![](/media/cache/profiles/cbc2ff16600e75703756975f9ba0586c.jpg.50x50_q85.jpg)
Camera(LJ-DSC02)
Dependencies: CameraC328 SDFileSystem mbed
Fork of Camera_LS_Y201_TestProgram_2014 by
main.cpp@1:7e547bf0f166, 2015-07-21 (annotated)
- Committer:
- Ricky_Kwon
- Date:
- Tue Jul 21 05:06:05 2015 +0000
- Revision:
- 1:7e547bf0f166
- Parent:
- 0:31be9011f67e
Camera(LJ-DSC02) with WIZwiki-W7500
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Ricky_Kwon | 1:7e547bf0f166 | 1 | /** |
Ricky_Kwon | 1:7e547bf0f166 | 2 | * Test program. |
Ricky_Kwon | 1:7e547bf0f166 | 3 | * |
Ricky_Kwon | 1:7e547bf0f166 | 4 | * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems) |
Ricky_Kwon | 1:7e547bf0f166 | 5 | * http://shinta.main.jp/ |
Ricky_Kwon | 1:7e547bf0f166 | 6 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 7 | |
Ricky_Kwon | 1:7e547bf0f166 | 8 | /* |
Ricky_Kwon | 1:7e547bf0f166 | 9 | * Include files. |
Ricky_Kwon | 1:7e547bf0f166 | 10 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 11 | |
shintamainjp | 0:31be9011f67e | 12 | #include "mbed.h" |
Ricky_Kwon | 1:7e547bf0f166 | 13 | #include "CameraC328.h" |
shintamainjp | 0:31be9011f67e | 14 | #include "SDFileSystem.h" |
Ricky_Kwon | 1:7e547bf0f166 | 15 | |
Ricky_Kwon | 1:7e547bf0f166 | 16 | /* |
Ricky_Kwon | 1:7e547bf0f166 | 17 | * Definitions. |
Ricky_Kwon | 1:7e547bf0f166 | 18 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 19 | #define USE_JPEG_HIGH_RESOLUTION 1 |
Ricky_Kwon | 1:7e547bf0f166 | 20 | #define USE_SD_CARD 1 |
Ricky_Kwon | 1:7e547bf0f166 | 21 | |
Ricky_Kwon | 1:7e547bf0f166 | 22 | /* |
Ricky_Kwon | 1:7e547bf0f166 | 23 | * Variables. |
Ricky_Kwon | 1:7e547bf0f166 | 24 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 25 | static const int CAPTURE_FRAMES = 5; |
Ricky_Kwon | 1:7e547bf0f166 | 26 | static const int RAWIMG_X = 10; |
Ricky_Kwon | 1:7e547bf0f166 | 27 | static const int RAWIMG_Y = 10; |
Ricky_Kwon | 1:7e547bf0f166 | 28 | static char buf[RAWIMG_X * RAWIMG_Y * 2]; |
Ricky_Kwon | 1:7e547bf0f166 | 29 | static FILE *fp_jpeg; |
Ricky_Kwon | 1:7e547bf0f166 | 30 | |
Ricky_Kwon | 1:7e547bf0f166 | 31 | /* |
Ricky_Kwon | 1:7e547bf0f166 | 32 | * Modules. |
Ricky_Kwon | 1:7e547bf0f166 | 33 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 34 | #if USE_SD_CARD |
Ricky_Kwon | 1:7e547bf0f166 | 35 | SDFileSystem sd(PB_3, PB_2, PB_1, PB_0, "fs"); // the pinout on the mbed Cool Components workshop board |
shintamainjp | 0:31be9011f67e | 36 | #else |
Ricky_Kwon | 1:7e547bf0f166 | 37 | LocalFileSystem fs("fs"); |
shintamainjp | 0:31be9011f67e | 38 | #endif |
Ricky_Kwon | 1:7e547bf0f166 | 39 | CameraC328 camera(PA_14, PA_13, CameraC328::Baud14400); |
shintamainjp | 0:31be9011f67e | 40 | /** |
Ricky_Kwon | 1:7e547bf0f166 | 41 | * A callback function for uncompressed images. |
Ricky_Kwon | 1:7e547bf0f166 | 42 | * Please do NOT block this callback function. |
Ricky_Kwon | 1:7e547bf0f166 | 43 | * Because the camera module transmit image datas continuously. |
Ricky_Kwon | 1:7e547bf0f166 | 44 | * |
Ricky_Kwon | 1:7e547bf0f166 | 45 | * @param done a done number of packets. |
Ricky_Kwon | 1:7e547bf0f166 | 46 | * @param total a total number of packets. |
Ricky_Kwon | 1:7e547bf0f166 | 47 | * @param c received data. |
Ricky_Kwon | 1:7e547bf0f166 | 48 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 49 | void uncompressed_callback(size_t done, size_t total, char c) { |
Ricky_Kwon | 1:7e547bf0f166 | 50 | buf[done - 1] = c; |
Ricky_Kwon | 1:7e547bf0f166 | 51 | } |
Ricky_Kwon | 1:7e547bf0f166 | 52 | |
Ricky_Kwon | 1:7e547bf0f166 | 53 | /** |
Ricky_Kwon | 1:7e547bf0f166 | 54 | * A callback function for jpeg images. |
Ricky_Kwon | 1:7e547bf0f166 | 55 | * You can block this function until saving the image datas. |
shintamainjp | 0:31be9011f67e | 56 | * |
Ricky_Kwon | 1:7e547bf0f166 | 57 | * @param buf A pointer to the image buffer. |
Ricky_Kwon | 1:7e547bf0f166 | 58 | * @param siz A size of the image buffer. |
Ricky_Kwon | 1:7e547bf0f166 | 59 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 60 | void jpeg_callback(char *buf, size_t siz) { |
Ricky_Kwon | 1:7e547bf0f166 | 61 | for (int i = 0; i < (int)siz; i++) { |
Ricky_Kwon | 1:7e547bf0f166 | 62 | fprintf(fp_jpeg, "%c", buf[i]); |
Ricky_Kwon | 1:7e547bf0f166 | 63 | } |
Ricky_Kwon | 1:7e547bf0f166 | 64 | } |
Ricky_Kwon | 1:7e547bf0f166 | 65 | |
Ricky_Kwon | 1:7e547bf0f166 | 66 | /** |
Ricky_Kwon | 1:7e547bf0f166 | 67 | * Synchronizing. |
Ricky_Kwon | 1:7e547bf0f166 | 68 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 69 | void sync(void) { |
Ricky_Kwon | 1:7e547bf0f166 | 70 | CameraC328::ErrorNumber err = CameraC328::NoError; |
Ricky_Kwon | 1:7e547bf0f166 | 71 | |
Ricky_Kwon | 1:7e547bf0f166 | 72 | err = camera.sync(); |
Ricky_Kwon | 1:7e547bf0f166 | 73 | if (CameraC328::NoError == err) { |
Ricky_Kwon | 1:7e547bf0f166 | 74 | printf("[ OK ] : CameraC328::sync\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 75 | } else { |
Ricky_Kwon | 1:7e547bf0f166 | 76 | printf("[FAIL] : CameraC328::sync (Error=%02X)\n", (int)err); |
Ricky_Kwon | 1:7e547bf0f166 | 77 | } |
Ricky_Kwon | 1:7e547bf0f166 | 78 | } |
Ricky_Kwon | 1:7e547bf0f166 | 79 | |
Ricky_Kwon | 1:7e547bf0f166 | 80 | /** |
Ricky_Kwon | 1:7e547bf0f166 | 81 | * A test function for uncompressed snapshot picture. |
shintamainjp | 0:31be9011f67e | 82 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 83 | void test_uncompressed_snapshot_picture(void) { |
Ricky_Kwon | 1:7e547bf0f166 | 84 | CameraC328::ErrorNumber err = CameraC328::NoError; |
Ricky_Kwon | 1:7e547bf0f166 | 85 | |
Ricky_Kwon | 1:7e547bf0f166 | 86 | err = camera.init(CameraC328::Color16bit, CameraC328::RawResolution80x60, CameraC328::JpegResolution160x128); |
Ricky_Kwon | 1:7e547bf0f166 | 87 | if (CameraC328::NoError == err) { |
Ricky_Kwon | 1:7e547bf0f166 | 88 | printf("[ OK ] : CameraC328::init\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 89 | } else { |
Ricky_Kwon | 1:7e547bf0f166 | 90 | printf("[FAIL] : CameraC328::init (Error=%02X)\n", (int)err); |
Ricky_Kwon | 1:7e547bf0f166 | 91 | } |
Ricky_Kwon | 1:7e547bf0f166 | 92 | |
Ricky_Kwon | 1:7e547bf0f166 | 93 | for (int i = 0; i < CAPTURE_FRAMES; i++) { |
Ricky_Kwon | 1:7e547bf0f166 | 94 | err = camera.getUncompressedSnapshotPicture(uncompressed_callback); |
Ricky_Kwon | 1:7e547bf0f166 | 95 | if (CameraC328::NoError == err) { |
Ricky_Kwon | 1:7e547bf0f166 | 96 | printf("[ OK ] : CameraC328::getUncompressedSnapshotPicture\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 97 | } else { |
Ricky_Kwon | 1:7e547bf0f166 | 98 | printf("[FAIL] : CameraC328::getUncompressedSnapshotPicture (Error=%02X)\n", (int)err); |
Ricky_Kwon | 1:7e547bf0f166 | 99 | } |
Ricky_Kwon | 1:7e547bf0f166 | 100 | |
Ricky_Kwon | 1:7e547bf0f166 | 101 | char fname[64]; |
Ricky_Kwon | 1:7e547bf0f166 | 102 | snprintf(fname, sizeof(fname), "/fs/ucss%04d.ppm", i); |
Ricky_Kwon | 1:7e547bf0f166 | 103 | FILE *fp = fopen(fname, "w"); |
Ricky_Kwon | 1:7e547bf0f166 | 104 | fprintf(fp, "P3\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 105 | fprintf(fp, "%d %d\n", RAWIMG_X, RAWIMG_Y); |
Ricky_Kwon | 1:7e547bf0f166 | 106 | fprintf(fp, "%d\n", 255); |
Ricky_Kwon | 1:7e547bf0f166 | 107 | for (int y = 0; y < RAWIMG_Y; y++) { |
Ricky_Kwon | 1:7e547bf0f166 | 108 | for (int x = 0; x < RAWIMG_X; x++) { |
Ricky_Kwon | 1:7e547bf0f166 | 109 | int adrofs = y * (RAWIMG_X * 2) + (x * 2); |
Ricky_Kwon | 1:7e547bf0f166 | 110 | uint16_t dat = (buf[adrofs + 0] << 8) | (buf[adrofs + 1] << 0); |
Ricky_Kwon | 1:7e547bf0f166 | 111 | uint8_t r = ((dat >> 11) & 0x1f) << 3; |
Ricky_Kwon | 1:7e547bf0f166 | 112 | uint8_t g = ((dat >> 5) & 0x3f) << 2; |
Ricky_Kwon | 1:7e547bf0f166 | 113 | uint8_t b = ((dat >> 0) & 0x1f) << 3; |
Ricky_Kwon | 1:7e547bf0f166 | 114 | fprintf(fp,"%d %d %d\n", r, g, b); |
Ricky_Kwon | 1:7e547bf0f166 | 115 | } |
Ricky_Kwon | 1:7e547bf0f166 | 116 | } |
Ricky_Kwon | 1:7e547bf0f166 | 117 | fclose(fp); |
shintamainjp | 0:31be9011f67e | 118 | } |
shintamainjp | 0:31be9011f67e | 119 | } |
Ricky_Kwon | 1:7e547bf0f166 | 120 | |
shintamainjp | 0:31be9011f67e | 121 | /** |
Ricky_Kwon | 1:7e547bf0f166 | 122 | * A test function for uncompressed preview picture. |
shintamainjp | 0:31be9011f67e | 123 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 124 | void test_uncompressed_preview_picture(void) { |
Ricky_Kwon | 1:7e547bf0f166 | 125 | CameraC328::ErrorNumber err = CameraC328::NoError; |
Ricky_Kwon | 1:7e547bf0f166 | 126 | |
Ricky_Kwon | 1:7e547bf0f166 | 127 | err = camera.init(CameraC328::Color16bit, CameraC328::RawResolution80x60, CameraC328::JpegResolution160x128); |
Ricky_Kwon | 1:7e547bf0f166 | 128 | if (CameraC328::NoError == err) { |
Ricky_Kwon | 1:7e547bf0f166 | 129 | printf("[ OK ] : CameraC328::init\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 130 | } else { |
Ricky_Kwon | 1:7e547bf0f166 | 131 | printf("[FAIL] : CameraC328::init (Error=%02X)\n", (int)err); |
Ricky_Kwon | 1:7e547bf0f166 | 132 | } |
Ricky_Kwon | 1:7e547bf0f166 | 133 | |
Ricky_Kwon | 1:7e547bf0f166 | 134 | for (int i = 0; i < CAPTURE_FRAMES; i++) { |
Ricky_Kwon | 1:7e547bf0f166 | 135 | err = camera.getUncompressedPreviewPicture(uncompressed_callback); |
Ricky_Kwon | 1:7e547bf0f166 | 136 | if (CameraC328::NoError == err) { |
Ricky_Kwon | 1:7e547bf0f166 | 137 | printf("[ OK ] : CameraC328::getUncompressedPreviewPicture\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 138 | } else { |
Ricky_Kwon | 1:7e547bf0f166 | 139 | printf("[FAIL] : CameraC328::getUncompressedPreviewPicture (Error=%02X)\n", (int)err); |
Ricky_Kwon | 1:7e547bf0f166 | 140 | } |
Ricky_Kwon | 1:7e547bf0f166 | 141 | |
Ricky_Kwon | 1:7e547bf0f166 | 142 | char fname[64]; |
Ricky_Kwon | 1:7e547bf0f166 | 143 | snprintf(fname, sizeof(fname), "/fs/ucpv%04d.ppm", i); |
Ricky_Kwon | 1:7e547bf0f166 | 144 | FILE *fp = fopen(fname, "w"); |
Ricky_Kwon | 1:7e547bf0f166 | 145 | fprintf(fp, "P3\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 146 | fprintf(fp, "%d %d\n", RAWIMG_X, RAWIMG_Y); |
Ricky_Kwon | 1:7e547bf0f166 | 147 | fprintf(fp, "%d\n", 255); |
Ricky_Kwon | 1:7e547bf0f166 | 148 | for (int y = 0; y < RAWIMG_Y; y++) { |
Ricky_Kwon | 1:7e547bf0f166 | 149 | for (int x = 0; x < RAWIMG_X; x++) { |
Ricky_Kwon | 1:7e547bf0f166 | 150 | int adrofs = y * (RAWIMG_X * 2) + (x * 2); |
Ricky_Kwon | 1:7e547bf0f166 | 151 | uint16_t dat = (buf[adrofs + 0] << 8) | (buf[adrofs + 1] << 0); |
Ricky_Kwon | 1:7e547bf0f166 | 152 | uint8_t r = ((dat >> 11) & 0x1f) << 3; |
Ricky_Kwon | 1:7e547bf0f166 | 153 | uint8_t g = ((dat >> 5) & 0x3f) << 2; |
Ricky_Kwon | 1:7e547bf0f166 | 154 | uint8_t b = ((dat >> 0) & 0x1f) << 3; |
Ricky_Kwon | 1:7e547bf0f166 | 155 | fprintf(fp,"%d %d %d\n", r, g, b); |
Ricky_Kwon | 1:7e547bf0f166 | 156 | } |
Ricky_Kwon | 1:7e547bf0f166 | 157 | } |
Ricky_Kwon | 1:7e547bf0f166 | 158 | fclose(fp); |
Ricky_Kwon | 1:7e547bf0f166 | 159 | } |
Ricky_Kwon | 1:7e547bf0f166 | 160 | } |
Ricky_Kwon | 1:7e547bf0f166 | 161 | |
Ricky_Kwon | 1:7e547bf0f166 | 162 | /** |
Ricky_Kwon | 1:7e547bf0f166 | 163 | * A test function for jpeg snapshot picture. |
Ricky_Kwon | 1:7e547bf0f166 | 164 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 165 | void test_jpeg_snapshot_picture(void) { |
Ricky_Kwon | 1:7e547bf0f166 | 166 | CameraC328::ErrorNumber err = CameraC328::NoError; |
Ricky_Kwon | 1:7e547bf0f166 | 167 | |
Ricky_Kwon | 1:7e547bf0f166 | 168 | #if USE_JPEG_HIGH_RESOLUTION |
Ricky_Kwon | 1:7e547bf0f166 | 169 | err = camera.init(CameraC328::Jpeg, CameraC328::RawResolution80x60, CameraC328::JpegResolution640x480); |
Ricky_Kwon | 1:7e547bf0f166 | 170 | #else |
Ricky_Kwon | 1:7e547bf0f166 | 171 | err = camera.init(CameraC328::Jpeg, CameraC328::RawResolution80x60, CameraC328::JpegResolution320x240); |
Ricky_Kwon | 1:7e547bf0f166 | 172 | #endif |
Ricky_Kwon | 1:7e547bf0f166 | 173 | if (CameraC328::NoError == err) { |
Ricky_Kwon | 1:7e547bf0f166 | 174 | printf("[ OK ] : CameraC328::init\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 175 | } else { |
Ricky_Kwon | 1:7e547bf0f166 | 176 | printf("[FAIL] : CameraC328::init (Error=%02X)\n", (int)err); |
shintamainjp | 0:31be9011f67e | 177 | } |
Ricky_Kwon | 1:7e547bf0f166 | 178 | |
Ricky_Kwon | 1:7e547bf0f166 | 179 | for (int i = 0; i < CAPTURE_FRAMES; i++) { |
Ricky_Kwon | 1:7e547bf0f166 | 180 | char fname[64]; |
Ricky_Kwon | 1:7e547bf0f166 | 181 | snprintf(fname, sizeof(fname), "/fs/jpss%04d.jpg", i); |
Ricky_Kwon | 1:7e547bf0f166 | 182 | fp_jpeg = fopen(fname, "w"); |
Ricky_Kwon | 1:7e547bf0f166 | 183 | |
Ricky_Kwon | 1:7e547bf0f166 | 184 | err = camera.getJpegSnapshotPicture(jpeg_callback); |
Ricky_Kwon | 1:7e547bf0f166 | 185 | if (CameraC328::NoError == err) { |
Ricky_Kwon | 1:7e547bf0f166 | 186 | printf("[ OK ] : CameraC328::getJpegSnapshotPicture\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 187 | } else { |
Ricky_Kwon | 1:7e547bf0f166 | 188 | printf("[FAIL] : CameraC328::getJpegSnapshotPicture (Error=%02X)\n", (int)err); |
Ricky_Kwon | 1:7e547bf0f166 | 189 | } |
Ricky_Kwon | 1:7e547bf0f166 | 190 | |
Ricky_Kwon | 1:7e547bf0f166 | 191 | fclose(fp_jpeg); |
Ricky_Kwon | 1:7e547bf0f166 | 192 | } |
Ricky_Kwon | 1:7e547bf0f166 | 193 | } |
Ricky_Kwon | 1:7e547bf0f166 | 194 | |
Ricky_Kwon | 1:7e547bf0f166 | 195 | /** |
Ricky_Kwon | 1:7e547bf0f166 | 196 | * A test function for jpeg preview picture. |
Ricky_Kwon | 1:7e547bf0f166 | 197 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 198 | void test_jpeg_preview_picture(void) { |
Ricky_Kwon | 1:7e547bf0f166 | 199 | CameraC328::ErrorNumber err = CameraC328::NoError; |
Ricky_Kwon | 1:7e547bf0f166 | 200 | |
Ricky_Kwon | 1:7e547bf0f166 | 201 | #if USE_JPEG_HIGH_RESOLUTION |
Ricky_Kwon | 1:7e547bf0f166 | 202 | err = camera.init(CameraC328::Jpeg, CameraC328::RawResolution80x60, CameraC328::JpegResolution640x480); |
Ricky_Kwon | 1:7e547bf0f166 | 203 | #else |
Ricky_Kwon | 1:7e547bf0f166 | 204 | err = camera.init(CameraC328::Jpeg, CameraC328::RawResolution80x60, CameraC328::JpegResolution320x240); |
Ricky_Kwon | 1:7e547bf0f166 | 205 | #endif |
Ricky_Kwon | 1:7e547bf0f166 | 206 | if (CameraC328::NoError == err) { |
Ricky_Kwon | 1:7e547bf0f166 | 207 | printf("[ OK ] : CameraC328::init\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 208 | } else { |
Ricky_Kwon | 1:7e547bf0f166 | 209 | printf("[FAIL] : CameraC328::init (Error=%02X)\n", (int)err); |
shintamainjp | 0:31be9011f67e | 210 | } |
Ricky_Kwon | 1:7e547bf0f166 | 211 | |
Ricky_Kwon | 1:7e547bf0f166 | 212 | for (int i = 0; i < CAPTURE_FRAMES; i++) { |
Ricky_Kwon | 1:7e547bf0f166 | 213 | char fname[64]; |
Ricky_Kwon | 1:7e547bf0f166 | 214 | snprintf(fname, sizeof(fname), "/fs/jppv%04d.jpg", i); |
Ricky_Kwon | 1:7e547bf0f166 | 215 | fp_jpeg = fopen(fname, "w"); |
Ricky_Kwon | 1:7e547bf0f166 | 216 | |
Ricky_Kwon | 1:7e547bf0f166 | 217 | err = camera.getJpegPreviewPicture(jpeg_callback); |
Ricky_Kwon | 1:7e547bf0f166 | 218 | if (CameraC328::NoError == err) { |
Ricky_Kwon | 1:7e547bf0f166 | 219 | printf("[ OK ] : CameraC328::getJpegPreviewPicture\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 220 | } else { |
Ricky_Kwon | 1:7e547bf0f166 | 221 | printf("[FAIL] : CameraC328::getJpegPreviewPicture (Error=%02X)\n", (int)err); |
Ricky_Kwon | 1:7e547bf0f166 | 222 | } |
Ricky_Kwon | 1:7e547bf0f166 | 223 | |
Ricky_Kwon | 1:7e547bf0f166 | 224 | fclose(fp_jpeg); |
shintamainjp | 0:31be9011f67e | 225 | } |
Ricky_Kwon | 1:7e547bf0f166 | 226 | } |
Ricky_Kwon | 1:7e547bf0f166 | 227 | |
Ricky_Kwon | 1:7e547bf0f166 | 228 | /** |
Ricky_Kwon | 1:7e547bf0f166 | 229 | * A entry point. |
Ricky_Kwon | 1:7e547bf0f166 | 230 | */ |
Ricky_Kwon | 1:7e547bf0f166 | 231 | int main() { |
Ricky_Kwon | 1:7e547bf0f166 | 232 | printf("\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 233 | printf("==========\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 234 | printf("CameraC328\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 235 | printf("==========\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 236 | |
Ricky_Kwon | 1:7e547bf0f166 | 237 | sync(); |
Ricky_Kwon | 1:7e547bf0f166 | 238 | // test_uncompressed_snapshot_picture(); |
Ricky_Kwon | 1:7e547bf0f166 | 239 | // test_uncompressed_preview_picture(); |
Ricky_Kwon | 1:7e547bf0f166 | 240 | // test_jpeg_preview_picture(); |
Ricky_Kwon | 1:7e547bf0f166 | 241 | test_jpeg_snapshot_picture(); |
Ricky_Kwon | 1:7e547bf0f166 | 242 | |
Ricky_Kwon | 1:7e547bf0f166 | 243 | /*printf("Hello World!\n"); |
shintamainjp | 0:31be9011f67e | 244 | |
Ricky_Kwon | 1:7e547bf0f166 | 245 | mkdir("/fs/mydir", 0777); |
Ricky_Kwon | 1:7e547bf0f166 | 246 | |
Ricky_Kwon | 1:7e547bf0f166 | 247 | FILE *fp = fopen("/fs/mydir/sdtest.txt", "w"); |
Ricky_Kwon | 1:7e547bf0f166 | 248 | if(fp == NULL) { |
Ricky_Kwon | 1:7e547bf0f166 | 249 | error("Could not open file for write\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 250 | } |
Ricky_Kwon | 1:7e547bf0f166 | 251 | fprintf(fp, "Hello fun SD Card World!"); |
Ricky_Kwon | 1:7e547bf0f166 | 252 | fclose(fp); |
shintamainjp | 0:31be9011f67e | 253 | |
Ricky_Kwon | 1:7e547bf0f166 | 254 | printf("Goodbye World!\n"); |
Ricky_Kwon | 1:7e547bf0f166 | 255 | return 0;*/ |
Ricky_Kwon | 1:7e547bf0f166 | 256 | } |