Go Down

Topic: Running Arduino sketches on the Pi (Read 7579 times) previous topic - next topic

ArthurD

Quote
Running Arduino sketches on the Pi

Postby kolban ยป Wed Feb 03, 2016 2:09 am
A new project can be found on Github here:

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

Which provides the ability to compile Arduino sketches using the Arduino IDE on either Windows or Linux and run the resulting binaries on the Raspberry Pi.

A video tutorial has been built which illustrates getting the solution up and running. That video can be found here:

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

In the video, we only show getting it going for the B+ and Pi 2 but we can also run the solution on the Pi Zero and other variants.

In another video, we show how to write binaries directly to the Pi file system:

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

dmjlambert

I think that is interesting and useful.   

Now if the Arduino IDE was running on the Pi, the extra features were added via the Boards Manager, and sketches wrote were deposited as executables in some directory on the Pi instead of "uploading" or transferring via Samba that would be fabulous.   It would be similar to the way PCduino is supposed to work.   

To take it one step further, having an option to run the sketch on the Pi as bare metal and only boot up Linux on the Pi if a particular IO pin is grounded, that would be even better.   

ArthurD

I agree, Linux user space is not a blessing - it's actually a curse.

Isaac96

Now I have a reason for getting a Pi Zero! That is awesome!
Do not PM me for help. I will delete immediately.
CONNECT THE GROUNDS!

After Tuesday, even the calendar goes W T F

bperrybap

Now I have a reason for getting a Pi Zero! That is awesome!
I have one, but I'm not a fan of the Pi zero.
It seems crazy to make a linux device that has no network connectivity.
To me it could have been a great IoT device if it just had built in wifi.
But not having a standard USB port and no network connectivity makes it not very useful to me.
I'd rather use the other models.


--- bill

john1993

in a way ONLY network connectivity although its not that difficult to get a console up too over ssh or serial.  by some miracle i managed to get 4 now with two in constant use over internet (security and media server).  one of the others as desktop pc running arduino ide, firefox, cad, 3d printer, etc but thats not its strong point.

in reality it has exactly one standard usb which can be expanded to 4 for less than a dollar with cheap ebay hubs. some even smaller than the pi.

considering one can have half dozen of these for cost of one of the other models they are very popular where cost IS a consideration.  half the power and 1/4 the size too.  so popular in fact you cannot buy more than one at a time anywhere and and even then only a couple sources.  so popular the waiting list may be months or years for some.  quite the phenomenon.

but imo its silly to compare with arduino like so many do.  bananas and oranges.  speaking of which pi "clones" are hardly competition in terms of cost, popularity, or support.

ArthurD

#6
Feb 15, 2016, 04:05 pm Last Edit: Feb 15, 2016, 08:23 pm by ArthurD
I personally would never purchase a Zero, not even a B+:
just the Pi 2B quadcore is powerful enough for all tasks, because Linux brakes down the whole computational performance which overtaxes a single-core.

But with my 2B I'm absolutely fine, I just purchased a 2nd one.
It costs 40 EUR incl. VAT and shipping (original, made in GB).
:)

Isaac96

I have one, but I'm not a fan of the Pi zero.
It seems crazy to make a linux device that has no network connectivity.
To me it could have been a great IoT device if it just had built in wifi.
But not having a standard USB port and no network connectivity makes it not very useful to me.
I'd rather use the other models.


--- bill
For wifi, try the C.H.I.P. $9.
Do not PM me for help. I will delete immediately.
CONNECT THE GROUNDS!

After Tuesday, even the calendar goes W T F

ArthurD

#8
Feb 19, 2016, 11:06 pm Last Edit: Feb 19, 2016, 11:08 pm by ArthurD
Pi Zero single core, 512kB RAM, 700 MHz, plus shipping plus USB hub plus external LAN = 30 EUR
Raspi 2 model B quadcore, 1GB RAM, 900 MHz, LAN, Wifi-ready, costs 40 EUR incl. shipping.

so what...?

HermannSW

#9
Jul 28, 2016, 11:30 pm Last Edit: Jul 28, 2016, 11:33 pm by HermannSW
> Pi Zero single core, 512kB RAM, 700 MHz, plus shipping plus USB hub plus external LAN = 30 EUR
>
What?

Raspberry Pi Zero is sold for 5$ + 5$ shipping from thepihut.com and pimoroni.com (they limit order to 1pc).

Only cable needed is USB to micro USB cable that every Arduino user should have plenty of.

You ssh into Pi Zero over USB (OTG), and with internet connection sharing Pi Zero has internet access as well (for "sudo apt-get ..."). Of course Arduino SPI ethernet module does work as well ( I did that before I was able to get internet connection sharing right, SPI ethernet gives 4.7 Mbps, internet connection sharing 19Mbps and Ubuntu over same cable give 91Mbps):
https://twitter.com/HermannSW/status/757941145804664832



Yesterday I installed "Raspberry" board into Arduino IDE following the corresponding chapter in Kolban's book:
https://twitter.com/HermannSW/status/756225040169988096

Arduino Blink sample worked immediately:
https://twitter.com/HermannSW/status/758360136813543425





Btw, Pi Zero is 1GHz, not 700MHZ. So "Raspberry" board for Arduino IDE makes "1GHz Arduino" available!

Hermann.
stepper PT camera system:
https://forum.arduino.cc/index.php?topic=647703.0
high precision linear actuator:
https://forum.arduino.cc/index.php?topic=645745.0
http://stamm-wilbrandt.de/en/Raspberry_camera.html

HermannSW

> I personally would never purchase a Zero, not even a B+:
> just the Pi 2B quadcore is powerful enough for all tasks, because Linux brakes
> down the whole computational performance which overtaxes a single-core.
>
Then "NanoPi Neo", quad core 1.2GHz A7 for just 8$ might be interesting:

"I did order two NanoPi Neo, with 7$ shipping for 23$ in total"
http://forum.arduino.cc/index.php?topic=412642.msg2842531#msg2842531
stepper PT camera system:
https://forum.arduino.cc/index.php?topic=647703.0
high precision linear actuator:
https://forum.arduino.cc/index.php?topic=645745.0
http://stamm-wilbrandt.de/en/Raspberry_camera.html

Chris_Tziros

#11
Sep 20, 2018, 01:43 am Last Edit: Sep 20, 2018, 01:47 am by Chris_Tziros
How are the pins specified in the arduino IDE beeing translated to the Raspberry pi GPIO pins? I mean what is the matching? Is there a link that i can see something lik: arduino pin 11 corresponds to raspberry GPIO pin 4

Go Up