• 双节履带机械臂小车实现蓝牙遥控功能


    1.功能描述

    本文示例所实现的功能为:采用蓝牙远程遥控双节履带机械臂小车进行运动。

    2.结构说明

    双节履带机械臂小车,采用履带底盘,可适用于任何复杂地形。 前节履带抬起高度不低于10cm,可用于履带车进行爬楼行进。 底盘上装有一个两自由度机械臂,可用于排爆等工作。

    3.电子硬件

    在这个示例中,我们采用了以下硬件,请大家参考:

     4.app安装与配置

    将文末资料中的“蓝牙串口助手.apk”安装到安卓手机中。将蓝牙模块连接到主控板并打开电源,然后在手机上运行蓝牙串口助手。

    按钮名称发送内容
    下撑0@0:0=0(90,90,201,201,30);@
    平铺0@0:0=0(90,90,201,201,90);@
    上撑0@0:0=0(90,90,201,201,150);@
    放下0@0:0=0(90,90,10,201,201);@
    前进0@0:0=0(70,110,201,201,201);@
    抬起0@0:0=0(90,90,40,201,201);@
    左转0@0:0=0(110,110,201,201,201);@
    停止0@0:0=0(90,90,201,201,201);@
    右转0@0:0=0(70,70,201,201,201);@
    打开0@0:0=0(90,90,201,150,201);@
    后退0@0:0=0(110,70,201,201,201);@
    夹取0@0:0=0(90,90,201,100,201);@

     5.功能实现

    编程环境:Arduino 1.8.19      下面提供一个蓝牙远程遥控双节履带机械臂小车运动的参考程序(EODrobot.ino):

    1. /*------------------------------------------------------------------------------------
    2. 版权说明:Copyright 2023 Robottime(Beijing) Technology Co., Ltd. All Rights Reserved.
    3. Distributed under MIT license.See file LICENSE for detail or copy at
    4. https://opensource.org/licenses/MIT
    5. by 机器谱 2023-09-04 https://www.robotway.com/
    6. ------------------------------*/
    7. #include
    8. #include
    9. #include
    10. #include
    11. #include
    12. String serialString = "";
    13. boolean serialComplete = false;
    14. char stringBuf[100];
    15. Protocol protocol;
    16. Servo myServo[5];
    17. int data[5];
    18. int olddata[5];
    19. int port[5] = {7,8,12,11,3};
    20. void setup()
    21. {
    22. Serial.begin(9600);
    23. for(int i = 0; i < 5; i++){
    24. data[i] = 201;
    25. myServo[i].attach(port[i]);
    26. }
    27. myServo[0].write(90);
    28. myServo[1].write(90);
    29. myServo[2].write(10);
    30. myServo[3].write(150);
    31. myServo[4].write(90);
    32. }
    33. void loop()
    34. {
    35. if (serialComplete) {
    36. protocol.Analyze(serialString);
    37. for(int i = 0; i < 5; i++)
    38. data[i] = protocol.parameter.GetAt(i);
    39. serialString = "";
    40. serialComplete = false;
    41. for(int i = 0; i < 5; i++){
    42. if(olddata[i] != data[i]){
    43. if(data[i] == 201)
    44. continue;
    45. else if(data[i] > 0 && data[i] < 180){
    46. myServo[i].write(data[i]);
    47. }
    48. olddata[i] = data[i];
    49. }
    50. }
    51. }
    52. }
    53. void serialEvent() {
    54. while (Serial.available()) {
    55. char inChar = (char)Serial.read();
    56. serialString += inChar;
    57. if (inChar == '\n') {
    58. serialComplete = true;
    59. }
    60. }
    61. }

     程序源代码、样机3D文件以及蓝牙串口助手.apk等资料详见  双节履带机械臂小车-蓝牙遥控

  • 相关阅读:
    Next.js 热更新 Markdown 文件变更
    基于Open3D的点云处理22-非阻塞可视化/动态可视化
    neo4j创建新数据库
    如何配置node.js环境
    openwrt移植4G CAT1 (L610) ——自动拨号,获取DNS,守护网络实时在线
    c++ qt 绘制设备
    Flutter开发好用插件url_launcher详解-启动 URL
    中国艺术孙溟㠭篆刻《绕绕》
    leetCode 76. 最小覆盖子串 + 滑动窗口 + 图解(详细)
    基于ssm或spingboot的企业员工信息系统
  • 原文地址:https://blog.csdn.net/Robotway/article/details/132949717