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?
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:
A tutorial video illustrating the installation steps can be found here:
A tutorial video illustrating how to publish directly to the Pi from the Arduino IDE can be found here:
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.