“MAi.startRest()”的版本间的差异
502748957@qq.com(讨论 | 贡献) (创建页面,内容为“{| style="width: 800px;" |- | <p style="color: #666666;font-size:220%">'''mAi.startRest()'''</p> <br> <p style="color: #E87E05;font-size:135%">描述</p> startRest()…”) |
502748957@qq.com(讨论 | 贡献) |
||
| 第14行: | 第14行: | ||
启动后要使用[[MAi.waitResult()]]函数等待识别结果 | 启动后要使用[[MAi.waitResult()]]函数等待识别结果 | ||
<source lang="cpp"> | <source lang="cpp"> | ||
| − | if(mAi.startRest()); | + | if(touch2.readEvent() == SHORT_PRESS) { |
| + | delay(500); | ||
| + | Serial.print("AT start Rest: "); | ||
| + | if(mAi.startRest()){ | ||
| + | Serial.println("OK!"); | ||
| + | int32_t code = mAi.waitResult(strBuf); | ||
| + | if(code){ | ||
| + | Serial.print("rest code: "); | ||
| + | Serial.print(code); | ||
| + | Serial.print(", result: "); | ||
| + | Serial.println(strBuf); | ||
| + | }else{ | ||
| + | Serial.println("rest none "); | ||
| + | } | ||
| + | }else{ | ||
| + | Serial.println("Failed!"); | ||
| + | } | ||
</source> | </source> | ||
|} | |} | ||
2018年12月13日 (四) 04:58的版本
|
mAi.startRest()
描述 startRest()函数用于启动语音识别模式
参数
实例 启动后要使用MAi.waitResult()函数等待识别结果 if(touch2.readEvent() == SHORT_PRESS) {
delay(500);
Serial.print("AT start Rest: ");
if(mAi.startRest()){
Serial.println("OK!");
int32_t code = mAi.waitResult(strBuf);
if(code){
Serial.print("rest code: ");
Serial.print(code);
Serial.print(", result: ");
Serial.println(strBuf);
}else{
Serial.println("rest none ");
}
}else{
Serial.println("Failed!");
}
|