Dependencies: mbed
Revision 7:575555ac3120, committed 2021-10-25
- Comitter:
- miyajitakenari
- Date:
- Mon Oct 25 10:23:16 2021 +0000
- Parent:
- 6:f692a3954e6a
- Commit message:
- okurutoki ha supe-suwo osu. message= gadetekitara nyuuryoku
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r f692a3954e6a -r 575555ac3120 main.cpp --- a/main.cpp Mon Oct 25 10:01:09 2021 +0000 +++ b/main.cpp Mon Oct 25 10:23:16 2021 +0000 @@ -4,28 +4,22 @@ Serial pc(SERIAL_TX, SERIAL_RX); ATP3011 talk(D4,D5); // I2C sda scl - - + /*地上局から新情報を送るときはflag=がでてきたらスペースか.を入力 + 3秒後ぐらいにmessage=が出てくるので、そしたら新情報を入力*/ int main(){ int timeout_ms=500; - int flag; char mess[100]; if(talk.IsActive(timeout_ms)==true){ - pc.printf("Active\n"); - wait(5) + pc.printf("Active\nflag="); + wait(3); if(pc.readable()){ - flag=1; - }else{ - flag=0; - } - if(flag==0){ - talk.Synthe("purissetommese-ji,,konnichiwa."); - }else if(flag==1){ pc.printf("message="); pc.scanf("%s",mess); talk.Synthe(mess); - } + }else{ + talk.Synthe("purissetommese-ji,,konnichiwa."); + } }else{ pc.printf("Not Active\n"); }