Dependencies:   mbed

Revision:
0:474bb4b8b095
Child:
1:14a5acd88fd6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 26 00:37:09 2021 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "ATP3011.h"
+ 
+Serial pc(SERIAL_TX, SERIAL_RX);
+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\nflag=");
+                   wait(3);
+                   if(pc.readable()){
+                       pc.printf("message=");
+                       pc.scanf("%s",mess);
+                       talk.Synthe(mess);
+                       }else{
+                           talk.Synthe("purissetommese-ji,,konnichiwa.");
+                           }
+                   }else{
+                       pc.printf("Not Active\n");
+                   }
+     }
+int main(){
+    speak();
+    return 0;
+    }
\ No newline at end of file