> For the complete documentation index, see [llms.txt](https://voltbro.gitbook.io/arduino-ros/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://voltbro.gitbook.io/arduino-ros/4_ros_arduino/sozdanie-izdatelya.md).

# Создание издателя

Рассмотрим пример программы **Издателя**, который публикует из Arduino в топик `chatter` текстовое сообщение "hello world!"

```c
#include <ros.h>
#include <std_msgs/String.h>

ros::NodeHandle nh;

std_msgs::String str_msg;
ros::Publisher chatter("chatter", &str_msg);

char hello[13] = "hello world!";

void setup()
{
  nh.initNode();
  nh.advertise(chatter);
}

void loop()
{
  str_msg.data = hello;
  chatter.publish( &str_msg );
  nh.spinOnce();
  delay(1000);
}
```

Загрузим скетч на плату`Arduino`.

После загрузки, зайдем на Raspberry и посмотрим, появился ли созданный топик:

```
rostopic list
```

Также мы можем вывести в консоль сообщение из топика:

```
rostopic echo /chatter
```
