Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 9:435ce4946f6c
- Parent:
- 8:765a73e21907
- Child:
- 10:6e02396abaf5
diff -r 765a73e21907 -r 435ce4946f6c main.cpp
--- a/main.cpp Fri Dec 06 08:35:28 2019 +0000
+++ b/main.cpp Fri Dec 06 09:09:42 2019 +0000
@@ -181,13 +181,18 @@
for (int r = 0; r < 1; r++) {
if (camera.isReady()) {
- char filename[32];
- sprintf(filename, "/local/pict%03d.jpg",r);
+
+ char filename[25];
+ snprintf(filename,25,"%s%03d%s", "/local/pict",r,".jpg");
printf("Picture: %s ", filename);
if (camera.takePicture(filename)) {
while (camera.isProcessing()) {
camera.processPicture();
- printf("take pictuer!");
+ printf("take picture!");
+
+ xbee.printf("xbee connnected!\r\n");
+ bs = new base64();
+ bs->Encode(filename,"/local/data.txt");
}
}else{
printf("take picture failed\r\n");
@@ -197,14 +202,9 @@
}
printf("time = %f\n", timer.read());
-
-
+
- xbee.printf("xbee connected!\r\n");
- bs = new base64();
- bs->Encode("/local/pict000.jpg","/local/data000.txt");
-
- if((fp=fopen("/local/data000.txt","r"))!=NULL)
+ if((fp=fopen("/local/data.txt","r"))!=NULL)
{
pc.printf("ok\r\n");
while((c=fgetc(fp))!=EOF){