Using I2C with BCM2835 driver on the Raspberry Pi
Hi,
Im currently trying to use a Raspberry Pi with ROS with some success, roscore works fine and all is well and good with the exception of one problem.
Im using the BCM2835 driver available at http://www. airspayce.com/mikem/bcm2835/ (followed the instructions and made the target and installed it with make install) This works when writing a normal executable when following the tutorials but I can't get it to work when writing it into a basic node. I think the problem is that it cant find the header files needed hence the "undefined reference" error when invoking "catkin_make", I have tried adding the following into the the CMakeList.txt to point ROS to the library.
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(include /home/pi/catkin_ws/src/bcm2835-1.26/src)
in the main code:
#include<bcm2835.h> //This with numerous variations including the full file path and without the .h
This of course had no effect I would ideally like to use the BCM2835 library for this project. I realize im making a rookie error and its just a case of organizing my libraries along with not a lot of Linux experience but im a little lost with it and would appreciate any help suggestions.
Many thanks