arduino代码

This commit is contained in:
astura
2026-07-18 18:22:58 +08:00
parent 2b7a320983
commit a2825ed71a
438 changed files with 36538 additions and 0 deletions
@@ -0,0 +1,30 @@
/*
* rosserial::std_msgs::Time Test
* Publishes current time
*/
#include <ros.h>
#include <ros/time.h>
#include <std_msgs/Time.h>
ros::NodeHandle nh;
std_msgs::Time test;
ros::Publisher p("my_topic", &test);
void setup()
{
pinMode(13, OUTPUT);
nh.initNode();
nh.advertise(p);
}
void loop()
{
test.data = nh.now();
p.publish( &test );
nh.spinOnce();
delay(10);
}