【Linux语音控制 安卓设备刷短视频 orangePi zero2 H616 (已开源) 】.md uptada:23/11/07

H616_实现Ubuntu语音控制安卓设备刷短视频

注意:orangePi zero2 H616 安装系统为ubuntu

小美效果展示

语言小美

H616 ubuntu系统 安装adb
  1. 在 Ubuntu PC 上安装 adb 工具
    test@test:~$ sudo apt update
    test@test:~$ sudo apt install -y adb

  2. 插入u口连接手机后,查看:
    test@test:~$ adb devices
    List of devices attached
    8c00141167058911ccd device

  3. 然后在 Ubuntu PC 上连接网络 adb
    // IP 地址需要修改为需控制的安卓手机IP 地址,并处于同一局域网段
    // 手机打开 开发者模式 开启adb调试
    test@test:~$ adb connect 192.168.1.xxx

  • daemon not running; starting now at tcp:5037
  • daemon started successfully
    connected to 192.168.1.xxx:5555
    test@test:~$ adb devices
    List of devices attached
    192.168.1.xxx:5555 device
  1. 拔掉u口数据线,断开与手机的有线连接;
    如果不断开 这时u口有线连接+局域网ip连接,会有两个设备,故为方便操作,断开数据线,只保留一个设备即可;有线连接也能用,但是无线更帅一点嘛;
    test@test:~$ adb devices
    List of devices attached
    8b983433 device
    192.168.1.166:5555 device

  2. 然后在 Ubuntu PC 上通过 adb shell 就可以登录 android 系统
    test@test:~$ adb shell
    huawei-p20:/ #

智能公元 SU-03T 离线语音模组 固件制作

在线官网 选择对应产品 纯离线方案制作固件并发布
下载固件后 据工具官方文档及工具烧录固件即可
具体制作示例(简易图形化操作即可完成固件定制):
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

配合串口实现 小美_控制安卓刷抖音

源码:

/* xiaomei shuaDouYin*/
#include <stdio.h>
#include <string.h>
#include <errno.h>
// #include <wiringPi.h>
// #include <wiringSerial.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include "uartTool.h" // 不使用wiringPi库,这里为自己封装的串口库;
// 详见往期:
//【全志H616 使用标准库 完成自制串口库(分文件实现) orangepi zero2(开源)】.md updata: 23/11/07:
// http://t.csdnimg.cn/IaKXW

int fd;

void* func1()
{
    char data[32] = {0};  
    while(1){
        memset(data,'\0',32);
        scanf("%s",data);
        //发送数据_串口
        mySerialsend (fd, data) ;     
    }
}

void* func2()
{
    char buf[32] = {0};
    while(1){
        while(mySerialread(fd,buf)){ 
        //接收数据_串口   
        printf("%s\n",buf);  
        //判断串口指令
        for(int i = 0; i < strlen(buf); i++){
            switch (buf[i]){                           
                case 'N':
                printf("next\n");
                system("adb shell input swipe 540 1300 540 500 100");
                break;
                case 'U':
                printf("up\n");
                system("adb shell input swipe 540 500 540 1300 100");
                break;
                case 'Z':
                printf("zan\n");
                system("adb shell input tap 350 1050");
                system("adb shell input tap 350 1050");
                break;
                case 'Q':
                printf("qu\n");
                system("adb shell input keyevent 26");
                break;
            }
        }
        }
    }
}

int main ()
{
    pthread_t t1,t2;
    if ((fd = mySerialOpen ("/dev/ttyS5", 115200)) < 0)
    {
        fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
        return 1 ;
    }    
    pthread_create(&t1,NULL,func1,NULL); 
    pthread_create(&t2,NULL,func2,NULL);     
    while(1){sleep(10);};    
    return 0 ;
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值