test
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:c9e6022f14b8
- Child:
- 1:c2988a885854
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 18 09:13:30 2021 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#include "ATP3011.h" + ATP3011 talk(D4,D5); // I2C sda scl + Serial pc(SERIAL_TX, SERIAL_RX); + + int main(){ + int timeout_ms=500; + char mess[100]; + pc.printf("message="); + pc.scanf("%s",mess); + int i; + if(talk.IsActive(timeout_ms)==true){ + pc.printf("Active\n"); + for(i=0;i<=10;i++){ + talk.Synthe("konnichiwa."); + talk.Synthe(mess); + } + }else{ + pc.printf("Not Active\n"); + } + + return 0; + }