微控制类

屏幕显示

显示helloworld,请将下面的代码在arduino中编译并烧录进basic即可

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

MyCobotBasic myCobot;

//定义一个Angles类型的变量angles,内容如下
Angles angles = { -0.0, -0.0, -0.0, -0.0, -0.0, -0.0 };           


void setup() {

  //打开通讯串口
  myCobot.setup();
  myCobot.powerOn();
  //赋值angles为{ 0, 0, 0, 0, 0, 0 };
  for(auto &val : angles)       
    val = 0.0;

  //关节回到原点
  myCobot.writeAngles(angles, 50);
  delay(5000);
}

void loop() {
  // put your main code here, to run repeatedly:
  M5.update();
  //显示HelloWorld
  M5.Lcd.drawString("Hello World! ", 20, 20, 1);

}

results matching ""

    No results matching ""