1. 创建文件helloworld.c
利用eclipse,在Firmware/src/examples下新建一个文件夹,命名为helloworld,里面创建一个helloworld.c,该程序是在输入helloworld命令的时候输出Hello World:
#include <px4_config.h>
#include <px4_tasks.h>
#include <px4_posix.h>
#include <unistd.h>
#include <stdio.h>
#include <poll.h>
#include <string.h>
__EXPORT int helloworld_main(int argc, char *argv[]);
int helloworld_main(int argc,char *argv[])
{
PX4_INFO("Hello World!");
return OK;
}