Did you include the IOT devkit version of Eclipse with samples? The source for the libs is on Github, and like Arduino, abstracts the h/w so the same C/C++ code runs on Gen1, Gen 2 and Edison. Easiest way to find the libraries is to go to any of our sensor pages on software.intel.com/iot, and click on the "add your own sensor, clone our repository" once there, look at examples, they have a lot more sensors enabled. Libraries are pre-installed on our board images, so they are linked at run-time. With the Arduino each sketch includes and compiles the libraries from source. Same effect, different deployment.
http://iotdk.intel.com/ is the source of all this goodness. ie the top of the tree, libraries, SD card images, source files for the Yocto packages, and opkg repositories that are more up to date than the SD image we have on the IOT site.
>Did you include the IOT devkit version of Eclipse with samples?
I believe so, I downloaded and installed the file iotdk-ide-win.7z.
In the links you gave i went here to try this example because i really want to be able to use mraa.
Eclipse does not complain about not finding #include "mraa.h"
yet in main it errors on mraa_init(); saying undefined reference.
In looking in the eclipse project list, there is an example for 5_cpp_mraa_analog_input
This one includes #include "mraa.hpp" instead of mraa.h and does not use mraa_init(); in main.
Which one is the proper way.
Brendan Le Foll (Intel) wrote:
Make sure you are linking against -lmraa. The headers for libmraa are in the standard /usr/include so will always be found however the linker will not 'guess'.
Thanks! adding -lmraa was the ticket!
hopefully i wont embarrass my self to much by asking how did you know to add that to the linker ?
Hi, does anybody manged an rx/tx read/write on pin 0 and 1 on the arduino dev kit in nativ c/c++ ? i would like to use the arduino gsm shield but not the arduino ide... i would like to programm a daemon for yocto in eclipse. unfortunately the mraa library only provides a init script for the uart... also tried to compile with arduino libraries by copie them to the hardware folder of the dev kit... so i could use the TTYUARTClass but that didn't worked neither...
Thanks in Advance
https://communities.intel.com/message/247139#247139 explains the Serial port mapping;
Pins 0,1 map to /dev/ttyMFD1
When I interfaced an adafruit GPS to pins 0,1 I just googled for standard linux code and changed the dev in the example.
Worked first go - I am at work so cannot post the code/link - but use google.