Statistics
| Branch: | Revision:

root / mikrokopter / arduino / src / main.cpp @ 58d82c77

History | View | Annotate | Download (346 Bytes)

1
#include "ArduinoHardware.h" // modified version in this directory
2
#include <ros.h>
3
#include <std_msgs/UInt16.h>
4

    
5
ros::NodeHandle nh;
6

    
7
std_msgs::UInt16 distance;
8
ros::Publisher range("range", &distance);
9

    
10
void setup()
11
{
12
  nh.initNode();
13
  nh.advertise(range);
14
}
15

    
16
void loop()
17
{
18
  distance.data = 12;
19
  range.publish(&distance);
20
  nh.spinOnce();
21
}