This is a basic LED example which can blink the LED connected to the first pin of Wiring Pi, that is the 12th pin on the board. The LED cathode is connected to the GND pin and 12th pin as an anode. The following image shows the circuit of Raspberry Pi with an LED:
We can create the example ROS package, using the following command:
$ catkin_create_pkg ros_wiring_example roscpp std_msgs
You will get the existing package from the ros_wiring_examples folder.
Create a src folder and create the following code called blink.cpp inside the src folder:
#include ...