0

Given the popularity of the Arduino IDE and the wealth of existing Arduino sketches, can I use the Arduino IDE to write or compile sketches that will run on the Raspberry Pi?

  • Why would you want to do this? Sure, many Arduino sketches could be compiled to run on the Pi, but many more would not because of the differences in hardware. – Milliways Feb 3 '16 at 3:25
  • The interesting thing is that, so far, we have found very few sketches that a actually don't work and in most cases, these highlight areas where the PiDuino library that provides an implementation of the Arduino library on the Pi hadn't gotten it right. Obviously any sketches that assume that they are running on ATmel processors or try be super efficient by poking Arduino registers and memory won't work ... but these appear to be the exception rather than the rule. Other than that, the premise can be that if one learns Arduino APIs ... why not use them? – Kolban Feb 3 '16 at 5:16
2

Yes you can compile programs on the Arduino IDE on Windows or Linux and the resulting executables can run directly on the Raspberry Pi. In order to achieve this there are a few steps to follow including installing the Arduino IDE, downloading a tool chain and, most importantly, installing the Github project found here:

https://github.com/me-no-dev/RasPiArduino

A tutorial video illustrating the installation steps can be found here:

https://www.youtube.com/watch?v=lZvhtfUlY8Y

A tutorial video illustrating how to publish directly to the Pi from the Arduino IDE can be found here:

https://www.youtube.com/watch?v=sd5NLSKp1QU

See also:

Disclaimer: Please note that I am a contributor to this Github project. If this post is believed to be considered "advertizing" we'll be glad to remove it. It is felt though that since this is an Open Source project and no similar projects can be found and the topic of Arduino compilation for Pi "feels" relevant ... we honestly believe it to be appropriate. However, if deemed not to be, we will remove this Q&A immediately upon request.

  • If you are the developer me-no-dev or a contributor to the above mentioned project that should be clearly disclosed. – Steve Robillard Feb 3 '16 at 1:09
  • Thanks Steve .. have added a disclaimer/disclosure ... hopefully this is a useful Q&A in the Pi Community stack exchange but if not, we will be delighted to remove it immediately upon request. – Kolban Feb 3 '16 at 1:21
  • The point is not to prevent you from advertising your project here. The disclaimer is needed so that people know your opinion of the project may be biased, that's all. – Dmitry Grigoryev Mar 7 '17 at 13:37

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.