Community
cancel
Showing results for 
Search instead for 
Did you mean: 
GSen1
New Contributor I
1,519 Views

Adafruit Motor Shield sample code does not work on Eclipse ide

Hello,

I found a sample code from here: https://software.intel.com/en-us/iot/hardware/sensors/adafruit-motor-shield IoT - Adafruit Motor Shield | Intel® Developer Zone and realised that its source code is already in eclipse's files (inside upm file) I wanted to test it with my Intel Galileo Gen 1 but when run this code several errors occured. For example one of them says "Type 'upm::AdafruitMS1438' could not be resolved". Eventhough the sample code include the header file, i think it can not reach inside of the header. What can I do to use that sample code?

Thanks

Tags (1)
11 Replies
Pablo_M_Intel
Employee
111 Views

Hi davulist,

Could you please share the error log that you're getting? Also, I would like to see the path to the header files, it has been reported that some folder names cause some error at the time of compiling.

Have you tried any other example? Do they run fine?

In the meantime you can check the suggestions in this thread http://stackoverflow.com/questions/21065616/multiple-could-not-be-resolved-problems-using-eclipse-wi... http://stackoverflow.com/questions/21065616/multiple-could-not-be-resolved-problems-using-eclipse-wi....

Regards,

Pablo

Pablo_M_Intel
Employee
111 Views

Hi davulist,

Any updates on this? Have you keep working on this issue?

Regards,

Pablo

GSen1
New Contributor I
111 Views

Hi PabloM_Intel

Somehow the error has changed to "undefined referenced to ...." Then I add upm-AdafruitMS1438 to the library in the linker and it worked. No more errors now. But i didn't use this code to drive a dc motor yet. I will try to do it today.

Pablo_M_Intel
Employee
111 Views

Hi davulist,

Please let us know your results. I don't think that adding the DC motor would affect the code or the Eclipse output message, as it has nothing to do with the software part. We'll still be waiting for your results.

Regards,

Pablo

GSen1
New Contributor I
111 Views

Hi PabloM_Intel

Now I am getting this error:

root@galileo:~# chmod 755 /tmp/sensor;/tmp/sensor ;exit

/tmp/sensor: error while loading shared libraries: libupm-l298.so.0: cannot open shared object file: No such file or directory

logout

my project's name is sensor and I am using l298 library. There is no error in the code and I added header file by using IoT Sensor Support in Eclipse ide but still galileo can not open the library file. What can I do?

Pablo_M_Intel
Employee
111 Views

Hi davulist,

Could you please tell us which image you're using? The uClibc image or the eglibc image? uClibc corresponds to the standard image, which would be the light image, while the eglibc would be the IoT one. Also, did you make sure to update the mraa and upm libraries?

Regards,

Pablo

GSen1
New Contributor I
111 Views

Hi PabloM_Intel

Yeah, I did some things to update mraa and upm libraries and it worked. Actually I still have upm 4.1 and mraa 0.9.0 but when I try to update, eclipse says it's up to date eventhoug there are upm 5.1 and mraa 0.9.6. But nevermind code is working. However I have another problem right now. I have adafruit motor shield version 1 and it has two motor drivers l293d on itself. Since there is no library for it I am using l298 library in the upm file. I ran the sample code which I found from here: https://github.com/intel-iot-devkit/upm/blob/master/examples/c%2B%2B/l298.cxx upm/l298.cxx at master · intel-iot-devkit/upm · GitHub DC motor worked but it doesn't work exactly like the code says. It only turns in one direction and then stops. And even sometimes (if I try to change the code a bit) it doesn't stop when the code stops. Once I connected 2 dc motors, the code has only one motor object but both of them began to turn in the same direction. One day later, I did exactly the same thing but this time only one of them worked. I don't know what's hapening? What should I do? Should I buy the real l298 circuit?

FTinetti
Honored Contributor I
111 Views

Are you using PWM pins?

Fernando.

GSen1
New Contributor I
111 Views

Hi FGT

Yes I am using pwm pins. For one motor for example I used 11, 4 and 8 pins as written in the sample code.

Pablo_M_Intel
Employee
111 Views

Hi @davulist,

It might be possible that not having the exact component is causing the issue, so you could buy the l298 and test it to see if the motors start working as expected. If you don't want to invest money in this new component I would suggest you to try modifying the library that you're using right now so that it works better for your current device (the l293d). This is no easy task however, but you can give a try.

Regards,

Pablo

GSen1
New Contributor I
111 Views

Hi PabloM_Intel

Yeah Adafruit has different components. I checked its schema and realised that it has a register shifter and it makes it very difficult to use the pins with l298 library. I didn't want to waste my time to write up a new library for it so I bought an l298N circuit.It worked great with the library. Problem solved! Thanks for your help.

Reply