修改LED灯的颜色(M5版本)

arduino

#include <MyCobotBasic.h>
#include <ParameterList.h>

MyCobotBasic myCobot;   

void setup() {
  myCobot.setup();
  myCobot.powerOn();
}

void loop() {
    myCobot.setLEDRGB(0XFF, 0, 0);       // set RGB show red
    delay(2000);
    myCobot.setLEDRGB(0, 0XFF, 0);       // set RGB show blue
    delay(2000);
    myCobot.setLEDRGB(0, 0, 0XFF);       // set RGB show green
    delay(2000);
}

python

C

WriteAngle(Joint joint, double value, int speed = DefaultSpeed)

  • 功能:发送单关节角度

  • 参数说明: 关节序号 = joint,取值范围 1-6; 指定角度值 = value,取值范围约-170°~ + 170° 指定速度 = speed, 取值范围 0~100;

  • 返回值:无

#include <cstdlib>
#include <iostream>
#include <chrono>
#include <thread>

#include <QCoreApplication>

#include "MyCobot.hpp"

int main(int argc, char* argv[])
try {
    QCoreApplication a(argc, argv);
    using namespace std::chrono_literals;
    if (!mycobot::MyCobot::I().IsControllerConnected()) {
        std::cerr << "Robot is not connected\n";
        exit(EXIT_FAILURE);
    }
    std::cout << "Robot is connected\n";
    //机械臂上电
    mycobot::MyCobot::I().PowerOn();
    //设置红色
    mycobot::MyCobot::I().setLEDRGB(255,0,0);

myblockly

  • 1.LED -
  • 2.设置颜色 -
  • 3.选择红绿蓝 -

roboflow

results matching ""

    No results matching ""