// // 语音识别模块 - “小创” // #include "VoiceIdentifyCommand.h" uint8_t VoiceIdentifyCommand::RandomDisc() { randomSeed(micros()); return random(0x00, 0x07); } bool VoiceIdentifyCommand::CMD_ReportAndIdentify() { uint8_t source = RandomDisc(); uint8_t result = BKRC_Voice.BKRC_Voice_Extern(source); return (source == (result - 0x01)); } void VoiceIdentifyCommand::CMD_ReportAnyText(String text) { TextEncoder encoder(text); while (encoder.HasNextChar()) { byte data[2] = { 0 }; Serial2.write(data, 2); delay(500); } }