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:
- 7:a47fdb7f9bc8
- Parent:
- 6:cf43f62b1e75
--- a/main.cpp Mon Dec 02 07:39:27 2019 +0000 +++ b/main.cpp Mon Dec 02 10:24:31 2019 +0000 @@ -98,22 +98,25 @@ fclose(fp); } } - for(int i=0;i<2;i++) { + 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/d.txt","r"))!=NULL) - { - while ((c=fgetc(fp))!=EOF){ - xbee.printf("%c",c); //再送 - - } - fclose(fp); - } - } - } + 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; + } + } + }else{//焦電反応なしの場合 printf("not found!\r\n");