Go Down

Topic: Programming in C (Read 5 times) previous topic - next topic

retrolefty

#5
Nov 23, 2012, 12:40 am Last Edit: Nov 23, 2012, 12:42 am by retrolefty Reason: 1

Ah... I alays thought it was C++ but the functions such as digitalWrite were "Arduino added" functions.

There are functions that come standard with the C and C++ programming languages, there are functions that come with 'standard libraries' supplied by compiler tool chain providers, and their are functions and libraries that Arduino includes with installation of the IDE and lastly there are any functions you yourself develop. Because a new function is developed and given to you for your use doesn't make the programming language being used not standard C++. Such functions are usually written in just standard C or C++ language.

Things like Serial.begin, are they also standard C++ functions?

No that 'standard' C++ functions. They are functions from libraries specifically developed for arduino that you can use or not use as you please. These functions are written in C++ and the source code for the functions are provided to you in the IDE distribution, if you wish to read them.

I suppose my question is now somewhat different, I believe the Arduino IDE allows one to omit certain parts that initialise things from a program?

Yes, there is an arduino pre-processor that supplies main() function and an initialization function that starts up timer0 interrupts to support the millis() and micros() functions. The pre-process also writes any needed function prototypes required for any functions you wrote in your sketch. I thinks that the limit of what it adds.
Lefty


tuxduino

Lefty, you (mis)use of quote tags is terrible :D Just copy-n-paste the generated quote header over each paragraph, or use anon quote tags. Bold answers look a bit like SHOUTING to be...

James C4S


Can we say Arduino is a combination of a hw platform + its own SDK ?

I think this is the most appropriate description.



Lefty, you (mis)use of quote tags is terrible :D Just copy-n-paste the generated quote header over each paragraph, or use anon quote tags. Bold answers look a bit like SHOUTING to be...

With over 12k posts, you haven't noticed that's how he responds?
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

jtw11

I shouldn't worry - I don't feel shouted at.

In the cores > arduino folder, which is the file that includes the source code for the functions such as digitalWrite?

Just downloading Notepad++ now to make things like this a little easier.

tuxduino



Lefty, you (mis)use of quote tags is terrible :D Just copy-n-paste the generated quote header over each paragraph, or use anon quote tags. Bold answers look a bit like SHOUTING to be...

With over 12k posts, you haven't noticed that's how he responds?


If something is wrong, repeating it 12k times doesn't make it right. Anyway that's the first and last time I'm going to complain about it. Tonight I just failed to keep myself from ot-posting... sorry :P

Go Up