Justwondering321 wrote:Hey guys, would it be possible to use the arduino language on the pi to control the GPIO pins??? Would be really really helpful if it would be possible!!! Let me know your thoughts!
points out above you can't use the Arduino IDE, but that's no loss. The Arduino programming language, for practical purposes, is C with Arduino extensions for accessing I/O ports. The same C compiler (GCC) is available on the Pi - in Debian it's installed by default - and if you install Gordon's wiringPi
that adds Arduino-type functions (digitalWrite(), digitalRead(), etc) for accessing the GPIO ports.
You will need to use makefiles - that's something that is hidden from you in the Arduino IDE - but if you start with Gordon's example programs and his makefiles you can modify the makefiles to suit your own programs. Once you get into it, it's a lot easier than it sounds.
You will also need an editor. I don't use Linux editors, by and large (see below), but there are several available. Geany seems to be quite popular; Nano is available from the command line and has prompts on-screen for the basic functions; Vi is available from the command line but gives you no clues whatsoever - not even how to get out of it.
My own preference, outlined in this post
, is to access the Pi remotely using a Windows pc to edit the files, with a terminal window to compile and execute them on the Pi. I dare say that Linux afficionados will shudder in disgust, but it works for me.