strinda
Posts: 3
Joined: Thu Jul 24, 2014 4:34 am

Arduino programming language

Thu Jul 24, 2014 4:40 am

Hi everyone,

I am sorry if this question has been raised elsewhere and I just didn't find the answer. I am a big fan of Arduini, and I like the language that is used to program Arduino boards.

I thought, there might be a similar language to use the Raspberry Pi pins for input / output? I have seen several Python examples, and If necessary I will learn this language, I just thought there is an easier way.

Thank you so much,
Alex

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Arduino programming language

Thu Jul 24, 2014 4:59 am

The language used to program an Arduino using the Arduino IDE is actually C++ with a number of libraries and some start up code. Gordon's wiringpi may be a good place to start

Code: Select all

WiringPi is an Arduino wiring-like library written in C
The only issue then remains that the Arduino IDE hides all the compiling/linking from you. There are general C/C++ IDEs around. Some appear to be too resource hungry to be useful on the Raspberry Pi.

Having said that learning Python is not hard, especially if you are already writing programs and there is a lot of code examples around using Python for the GPIOs on the Raspberry Pi and and IDE (Idle).

strinda
Posts: 3
Joined: Thu Jul 24, 2014 4:34 am

Re: Arduino programming language

Thu Jul 24, 2014 5:12 am

Hmm, now you get me really confused.

On the one hand, this WiringPi seems to be what I need. However, I am not sure the library will be updated in the future - why get into all the trouble of using something that will not supported in the future.

On the other hand, I know C++ and can learn Python, just I would use this language specifically to program RaspberryPi which is not really a very wide application. Additionally, I just love all those brackets and commas and semicolons that are lacking in Python.

I am in two minds about what to do.

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Arduino programming language

Thu Jul 24, 2014 5:22 am

strinda wrote:Hmm, now you get me really confused.
Sorry didn't mean to confuse you!
strinda wrote:On the one hand, this WiringPi seems to be what I need. However, I am not sure the library will be updated in the future - why get into all the trouble of using something that will not supported in the future.
There are a lot of people using WiringPi. Gordon is very actively developing WiringPi. I don't know why it wouldn't be supported in the future. The same could be said for any software (including the Python libraries that allow you to access the GPIOs).
strinda wrote:On the other hand, I know C++ and can learn Python, just I would use this language specifically to program RaspberryPi which is not really a very wide application. Additionally, I just love all those brackets and commas and semicolons that are lacking in Python.
Yes, I can relate to that I certainly was resistant to learning Python as my background is as a C/C++ programmer.
strinda wrote:I am in two minds about what to do.
It is really up to you. Learning is never wasted! Either way there is going to be learning to do. Either how to compile and link a C/C++ program on Linux (unless you already have this knowledge) or how to program in Python.

strinda
Posts: 3
Joined: Thu Jul 24, 2014 4:34 am

Re: Arduino programming language

Thu Jul 24, 2014 5:46 am

Thank you,
Your answer is very comprehensive, and it helped me a lot.
I will stick to WiringPi for the time being)

On the same topic,
I was thinking of using Processing for graphics, is there any other alternative worth looking at?

ghans
Posts: 7871
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Arduino programming language

Thu Jul 24, 2014 11:24 am

OpenVG with C (for 2D stuff).
https://github.com/ajstarks/openvg

Python with Pi3D
https://github.com/tipam/pi3d

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
A1i2T3R
Posts: 99
Joined: Sat Apr 13, 2013 1:08 pm
Location: England - Kent

Re: Arduino programming language

Thu Jul 24, 2014 5:19 pm

I am not sure but i think you might be able to download java or i have even seen examples of scratch being used! But ass long as you can download the language on linux you should be able to do it (in essence all languages can do the same but in different ways) However i think you would find it much more efficient to use python (There is lots of help out there for it) and it is nice and light weight. Ps. python is fairly easy to learn, i learnt it to a good level in two or three weeks with no prior experience in code. So seing as you know c++ you would be fine.
Enthusiastic pi user, with a hoby for modding everyday objects and using the pi as the brain!

User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Re: Arduino programming language

Mon Jul 28, 2014 1:25 pm

Thanks to ghans for the pointer to my OpenVG library. Just a quick note: the library supports Go as well as C.

Return to “Beginners”