Go Down

Topic: How to know the inside Arduino IDE language? (Read 451 times) previous topic - next topic

creativen

So far I have talked to many IT programmer that this Arduino programming using C++ language...
And they said that yes it uses C++ but using Arduino IDE so it put into 'boxes'...

For example: they never found 'digitalwrite' in C++, but it is found here...

I wonder how I open the box so I can get the pure C++ language, anyone could help me?

I hope you could understand what I'm trying to say, dont hesitate to reply/

Thank you :D

James C4S

There's no magic.  The Arduino core is just C / C++ code.

Depending on your operating system, the core functions can be found in:

install path/hardware/arduino/cores/arduino/

All of the Arduino functions are there and easily readable.  No boxes.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

creativen

Hmmm well I slightly mistaken said 'box'...
Yeah since it is open source so all is open...

But in C++ I never found digitalwrite, randomSeed, etc...
Could you help me how I understand the function (digitalwrite,etc) in the place you state before :install path/hardware/arduino/cores/arduino/?

James C4S

That's because digitalWrite(), digitialRead(), randsonSeed(), and etc are all parts of the Arduino core files.  They're just function calls specific to Arduino.

Find the core files in your Arduino installation (you still haven't bothered to say what Operating System you're using).  Then look at wiring_digital.c.  (If you're using OSX or Linux it is easy to use grep to find which file specific function calls are in.)
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

creativen

Wooo hooo I got it...
I'm using Windows XP SP2 anw...
So now I know how to the code communicate using C...
Anw, the C code is difficult to understand, it is easier directly know what the Arduino IDE language..

Many thanks!

Go Up