test
Dependents: LSI_Compass loop_test CanSat-C_test test
speak.h
- Committer:
- ushiroji
- Date:
- 2021-10-27
- Revision:
- 0:e190455d7dbb
- Child:
- 1:fe313ebd4f3b
File content as of revision 0:e190455d7dbb:
#include "ATP3011.h" ATP3011 talk(D4,D5); // I2C sda scl /*地上局から新情報を送るときは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("\n\rpreset_message speak"); talk.Synthe("purissetommese-ji,,konnichiwa."); } }else{ pc.printf("Not Active\n"); } }