I don't have an oscilloscope or logic analyzer to check the signals with. I have a cheap multimeter that shows a voltage of about 1.5V when i turn a pin on, but I think that is an error with the multimeter. The GPIO is set to translate to 3.3V, which I have tested and can confirm works on another microcontroller. My mraa version number is 0.7.3 and I recently updated my image to version 2.1. When I attempt to compile the example on mraa: Main Page I get a compilation "undefined reference to 'mraa_get_i2c_bus_count'" which leads me to believe that there is an issue with the mraa library.
Yes, you should have 3.3V if you have selected that option. I have just ran the same code with the 0.7.3 version and got the same error message. Then, I updated the MRAA library to the 0.7.4 version and I was able to run the example without problems.
Update the library and let us know if you get better results.
Ok. I've updated mraa (downloaded and built from source) to 0.7.5. I'm now getting an error linking "multiple definition of `mraa::getSubPlatformIndex(int)`". When I compile I have my "main.cc" that includes "SharpMemory.h" and within my header file I "#include "mraa.hpp". I then compile both my "main.cc" and "SharpMemory.cc" then I link them and include the mraa library with "-l mraa". I can prevent this error if I "#include "SharpMemory.cc" inside of my "main.cc" then just compile and link with mraa. Is this the correct way to be doing this? Or should I be doing this another way?
That looks like a compatibility issue, you could just update the mraa version using opkg. What you can do now is try to link the location of the mraa library using the -I flag: gcc -I option flag (include directory) You should do something like: gcc code.c -o output -I /usr/include/mraa
I'm still getting the same error, I've uploaded my Makefile and associated files. I'll try to update mraa when I get a chance.
Output from Makefile:
g++ -Wall -c -I /usr/include/mraa/ main.cc -o main.cc.o
g++ -Wall -c -I /usr/include/mraa/ SharpMemory.cc -o SharpMemory.cc.o
g++ -Wall -I /usr/include/mraa/ main.cc.o SharpMemory.cc.o -o sharp -l mraa
SharpMemory.cc.o: In function `mraa::getSubPlatformIndex(int)':
SharpMemory.cc:(.text+0x0): multiple definition of `mraa::getSubPlatformIndex(int)'
main.cc.o:main.cc:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
Makefile:19: recipe for target 'sharp' failed
make: *** [sharp] Error 1
Sharp.tar.gz 2.8 K
Ok. I've got mraa updated finally and it compiles without any errors.
To update libmraa I couldn't get opkg to work so instead I had to do:
"opkg install libmraa0_0.7.5+git0+effc813e42-r0_core2-32.ipk"
And now I don't get the multiple definition error.
I will update later if I can successfully control the screen.