1、2接线:
语音模块的TX——orangepi的RX
Android——orangepi
2、创建产品烧录固件:su-03t
网址:http://www.smartpi.cn/#/
配置b6为rx,b7为tx,波特率115200
设置好以后生成sdk,下载sdk,烧录sdk
测试结果:自己讲话可以接收到,并用串口输出16进制字符
3、编程实现语音指令识别
mkdir douyin:新建一个文件夹,进入文件夹
cp ../uart* . :将串口有关的文件拷贝过来一份
uartTool.c
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <stdarg.h> #include <string.h> #include <termios.h> #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include "wiringSerial.h" int myserialopen (const char *device, const int baud) { struct termios options ; speed_t myBaud ; int status, fd ; switch (baud){//选择波特率 case 9600: myBaud = B9600 ; break ; case 115200: myBaud = B115200 ; break ; } if ((fd = open (device, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK)) == -1) return -1 ;//打开控制字 fcntl (fd, F_SETFL, O_RDWR) ; // Get and modify current options: tcgetattr (fd, &options) ; cfmakeraw (&options) ; cfsetispeed (&options, myBaud) ;//进波特率 cfsetospeed (&opti