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
main.cpp
00001 #include "mbed.h" 00002 #include <stdio.h> 00003 #include <base64.h> 00004 00005 LocalFileSystem local("local"); 00006 00007 Serial pc(USBTX,USBRX); 00008 Serial xbee(p13, p14); 00009 00010 int main(){ 00011 FILE *fp; 00012 base64 *bs; 00013 int c; 00014 00015 xbee.printf("xbee connected!\r\n"); 00016 bs = new base64(); 00017 bs->Encode("/local/PICT001.jpg","/local/d.txt"); 00018 00019 if((fp=fopen("/local/d.txt","r"))!=NULL) 00020 { 00021 while ((c=fgetc(fp))!=EOF){ 00022 xbee.printf("%c",c); 00023 00024 } 00025 fclose(fp); 00026 } 00027 00028 while(1) { 00029 00030 int received_data = xbee.getc(); 00031 00032 if (received_data == 82 || received_data == 114){ //Rまたはr 00033 xbee.printf("_________________________________________________________________________________________________________________________________\r\n"); 00034 if((fp=fopen("/local/d.txt","r"))!=NULL) 00035 { 00036 while ((c=fgetc(fp))!=EOF){ 00037 xbee.printf("%c",c); //再送 00038 00039 } 00040 fclose(fp); 00041 } 00042 } 00043 } 00044 00045 return 0; 00046 } 00047
Generated on Thu Jul 21 2022 03:06:17 by
1.7.2