Is there any way to run Arduino sketches on Raspberry Pi (basically on Raspbian)? I have several projects that work on Arduino and I would like to run the exact same stuff on my Raspberry Pi. Is there a way to just put all the pins off the Arduino, put them on the Raspberry, then adjust the pin number settings in the Arduino sketch, and then run the program on Raspberry?
closed as off-topic by Anonymous Penguin Sep 25 '15 at 21:47
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question does not appear to be about Arduino, within the scope defined in the help center." – Anonymous Penguin
Given that most likely the Arduino code is accessing AVR specific registers, probably not, unless you have some compatibility library that redefines all the low level stuff.
I also wonder if you have the same set of peripherals available on the PI (ex: PWM generators and ADCs).
I would rather follow the "spirit" of the code you already have and re-implement it natively in you language of choice.
I assume you don't mean compiled code, but source; in which case
Processing would be a good place to look - it's interpreted IIRC so won't run hugely faster, and is 'mostly' compatible so YMMV depending what you're doing..
Arduino IDE is based upon that.
That answer is quite simple, no, this is not possible.