foc/arduino/head_file_test/main/main.ino

20 lines
421 B
Arduino
Raw Normal View History

2021-10-09 08:07:38 +00:00
#include "Command.h"
2021-10-11 07:07:48 +00:00
//命令设置
float target_velocity = 0;
Command comm;//声明一个自己的该类的对象
void doTarget(char* cmd) { comm.scalar(&target_velocity, cmd); }
2021-10-09 08:07:38 +00:00
void setup() {
// put your setup code here, to run once:
2021-10-11 07:07:48 +00:00
Serial.begin(115200);
comm.add("T",doTarget);
2021-10-09 08:07:38 +00:00
}
void loop() {
// put your main code here, to run repeatedly:
2021-10-11 07:07:48 +00:00
comm.run("T233.2548");
Serial.println(target_velocity);
2021-10-09 08:07:38 +00:00
}