Go Down

Topic: Arduino IDE to develop Raspberry Pi applications. (Read 655 times) previous topic - next topic

RIN67630

The idea migt sound crazy, but could it be possible to use the Arduino IDE to develop Raspberry Pi GPIO-Based applications ?

I just find the Arduino IDE design leaner: write code, compile, upload.
That's IMHO much more intuitive than bind modules, make and whatever...

pert

Here's one you can try out:
https://github.com/me-no-dev/RasPiArduino
There might be some other similar options.

There is also a feature of Arduino Create that allows you to program SBCs like the RPi:
https://blog.arduino.cc/2018/03/13/you-can-now-use-arduino-to-program-linux-iot-devices/
Unfortunately the official support for those boards is not also available in the Arduino IDE, only the Arduino Web Editor. So if you're set on using the Arduino IDE, you'll need to use a 3rd party hardware package like the one at the first link.

RIN67630

#2
Dec 28, 2018, 10:45 am Last Edit: Dec 28, 2018, 12:24 pm by RIN67630
Here's one you can try out:
https://github.com/me-no-dev/RasPiArduino
There might be some other similar options.

There is also a feature of Arduino Create that allows you to program SBCs like the RPi:
https://blog.arduino.cc/2018/03/13/you-can-now-use-arduino-to-program-linux-iot-devices/
Unfortunately the official support for those boards is not also available in the Arduino IDE, only the Arduino Web Editor. So if you're set on using the Arduino IDE, you'll need to use a 3rd party hardware package like the one at the first link.
Thank you. I see I was not crazy enough! Others had that idea before me.:-)
I had the Arduino IDE on the raspi itself in mind, but crosscompiling is also OK.
Maybe it will work with localhost as target address?
Let's test that the next weeks.

pert

I've never used either option so I can't provide any further information. Maybe someone else here on the forum has experience with this sort of thing and will chime in.

RIN67630

I've never used either option so I can't provide any further information. Maybe someone else here on the forum has experience with this sort of thing and will chime in.
I tried the first option, which seem to work on networked Raspi.
 
I miss however a better documentation on which features/libraries are supported and which aren't.
Unsurprisingly interrupts don't work and with them many libraries based on them.

I get some strange errors on library NRF24:
/RF24_config.h:112:0: warning: "_BV" redefined

  #define _BV(x) (1<<(x))

???

???


pert

I'm glad to hear it's working somewhat. I thought that project looked interesting, but I hadn't tried it.

Were you able to run the Arduino IDE on the RPi, and program that same RPi like you wanted to do?

/RF24_config.h:112:0: warning: "_BV" redefined

  #define _BV(x) (1<<(x))
That's a warning, not an error. A warning is the compiler telling you "this code is suspicious, you might want to take a look at it. Sometimes warnings indicate a serious problem, other times you can safely ignore them. An error is something that causes compilation to fail. That code will produce the same warning compiled for Uno. The warning should also show you the previous definition:
Code: [Select]
c:\users\per\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino4\avr\include\avr\sfr_defs.h:208:0: note: this is the location of the previous definition

 #define _BV(bit) (1 << (bit))

The two macros do the exact same thing so this is not a problem.

I'm not sure exactly what the purpose of this code was. Perhaps on some toolchains that macro is not defined. If so, they should have written it like this:
Code: [Select]
#ifndef _BV
#define _BV(x) (1<<(x))
#endif

Then it would not produce a warning when there was a previous definition of that macro.

Go Up