I tried to use arduPi library and I did what this page says : https://www.cooking-hacks.com/documentation/tutorials/raspberry-pi-to-arduino-shields-connection-bridge#step4

but I do not know what is wrong with it ? I tried to run arduPi.cpp file but unfortunately nothing worked

enter image description here

note : I have Pi 3


From what I can see you made a .o file (arduPi.o), not actually the arduPi program. This file is a library that you need to link into the compilation of whatever program you are building with that library. If you are trying to compile the test file arduPi.cpp, you would need to do this like so:

g++ -lrt -lpthread arduPi.cpp arduPi.o -o arduPi 

Once that is complete, you can do sudo ./arduPi.

I must say, the whole arduPi library and shield setup is marked as "Expert" level on the site you linked - if you do not understand the workings of the c++ compiler and how to link code libraries, it might make sense to read up on that first and get familiar before tackling the arduPi library.

| improve this answer | |
  • Thank you sir, but I did exactly as what you did, but when I typed "sudo ./arduPi". I get the message "command not found", I wonder why ? – test me Sep 16 '16 at 1:43
  • According to your screenshot you compiled arduPi.cpp without linking in the library, and with arduPi.o as the output. That is not correct. You should have first built arduPi.o using wget http://www.cooking-hacks.com/media/cooking/images/documentation/raspberry_arduino_shield/raspberrypi2.zip && unzip raspberrypi2.zip && cd cooking/arduPi && chmod +x install_arduPi && ./install_arduPi && rm install_arduPi && cd ../.. and then used that arduPi.o library to compile arduPi.cpp as per the g++-line above. – Phil B. Sep 16 '16 at 1:48
  • Sir I did what you said I wrote wget command and then I wrote g++ command too but it did not work too. I am sorry but I know nothing about c++ compiler do you have any idea how can I learn it with a few days please ? I really need that – test me Sep 16 '16 at 2:00
  • I forgot to say that the error message was "no such file or directory" – test me Sep 16 '16 at 2:20
  • You need to follow the instructions from your reference webpage one by one, with no mistakes/typos. Easiest is to just copy and execute. If you run into trouble with those - update your original question, show which steps you've done and what output you received, then ask for help. At this point I am not sure from which step your "no such file or directory" comes from. – Phil B. Sep 16 '16 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.