test
Dependents: LSI_Compass loop_test CanSat-C_test test
Diff: speak.h
- Revision:
- 4:6dd04e220a4c
- Parent:
- 1:fe313ebd4f3b
--- a/speak.h Thu Oct 28 09:34:05 2021 +0000 +++ b/speak.h Thu Nov 04 11:34:27 2021 +0000 @@ -4,25 +4,29 @@ /*地上局から新情報を送るときはflag=がでてきたらスペースか.を入力 3秒後ぐらいにmessage=が出てくるので、そしたら新情報を入力*/ -void speak(){ - int timeout_ms=500; - char mess[100]; - if(talk.IsActive(timeout_ms)==true){ - pc.printf("Active\n\rflag="); - wait(3); - if(pc.readable()){ - pc.printf("\n\rmessage="); - int i=0; - do{ - mess[i++]= pc.getc(); - }while(mess[i-1]!= 0x0d && i<99); - //pc.scanf("%s",mess); - talk.Synthe(mess); - }else{ - pc.printf("preset_message speak\r\n"); - talk.Synthe("purissetommese-ji,,konnichiwa."); - } - }else{ - pc.printf("Not Active\n"); - } +void speak() +{ + int timeout_ms=500; + char mess[100]; + if(talk.IsActive(timeout_ms)==true){ + pc.printf("Active\n\rflag="); + wait(3); + if(pc.readable()){ //pc.readable() + pc.printf("\n\rmessage="); + int i=0; + do{ + //mess[i++]= pc.getc(); + mess[i++]= pc.getc(); + } + while(mess[i-1]!= 0x0d && i<99); + talk.Synthe(mess); + } + else{ + pc.printf("preset_message speak\r\n"); + talk.Synthe("purissetommese-ji,,konnichiwa."); + } + } + else{ + pc.printf("Not Active\n"); + } } \ No newline at end of file