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:
- 22:6c30260dc2b6
- Parent:
- 21:548ac557ee95
- Child:
- 23:a04e970f1326
--- a/main.cpp Sat Dec 14 19:10:57 2019 +0000
+++ b/main.cpp Sat Dec 14 19:50:03 2019 +0000
@@ -217,63 +217,64 @@
FILE *fp;
base64 *bs;
int c;
+ for (int r = 0; r < 1; r++) {
+ if (camera.isReady()) {
+ 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();
- for (int r = 0; r < 1; r++) {
- if (camera.isReady()) {
- char filename[32];
- sprintf(filename, "/local/pict%03d.jpg",r);
- printf("Picture: %s ", filename);
- if (camera.takePicture(filename)) {
- while (camera.isProcessing()) {
- camera.processPicture();
- printf("take pictuer!");
- }
- }else{
- printf("take picture failed\r\n");
- }
- }else{
- printf("camera is not ready\r\n");
- }
+ xbee.printf("take pictuer!");
+
+ xbee.printf("xbee connected!!\r\n");
+
+ bs = new base64();
+ bs->Encode(filename,"/local/data.txt");
- printf("time = %f\n", timer.read());
-
-
+ printf("time = %f\n", timer.read());
+
- xbee.printf("i could take apicture!\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/d.txt","r"))!=NULL){
pc.printf("ok\r\n");
while((c=fgetc(fp))!=EOF){
- xbee.printf("%c",c);
+ xbee.printf("%c",c);
}
fclose(fp);
- }
+ }
}
- while(1){
+ }else{
+ printf("take picture failed\r\n");
+ }
+ }else{
+ printf("camera is not ready\r\n");
+ }
+ while(1){
- int received_data = xbee.getc();
+ int received_data = xbee.getc();
- if (received_data == 82 || received_data == 114){ //Rまたはr
- xbee.printf("_________________________________________________________________________________________________________________________________\r\n");
- if((fp=fopen("/local/data000.txt","r"))!=NULL)
- {
- while ((c=fgetc(fp))!=EOF){
- xbee.printf("%c",c); //再送
- }
- fclose(fp);
- }
- }
- else{
- break;
- }
- }
+ if (received_data == 82 || received_data == 114){ //Rまたはr
+
+ xbee.printf("_________________________________________________________________________________________________________________________________\r\n");
+ if((fp=fopen("/local/d.txt","r"))!=NULL) {
+ while ((c=fgetc(fp))!=EOF){
+
+ xbee.printf("%c",c); //再送
+ }
+ fclose(fp);
+ }
+ }else{
+ break;
+ }
+ }
- Sb612switch=0; //焦電off
- wait(1);
- }else{//焦電反応なしの場合
+ Sb612switch=0; //焦電off
+ wait(1);
+ }
+ }else{//焦電反応なしの場合
+
+
printf("not found!\r\n");