Go Down

Topic: What's is the ARDUINO constant telling me? (Read 303 times) previous topic - next topic

Zadaz

If I run this bit of code:

Code: [Select]
void setup() {
  Serial.begin(9600);
  Serial.println(ARDUINO);
}
void loop() {}

I get "101" in the serial window. Is that the IDE version (1.0.1) or is that a bootloader version or something else?

What other (apparently) undocumented constants like this are there?

(Sorry if this has been asked before, but as you might guess it's a bit troublesome to search.)

PaulS

Quote
I get "101" in the serial window. Is that the IDE version (1.0.1)

Yes.

Quote
What other (apparently) undocumented constants like this are there?

Nothing's undocumented in the sense that it's hidden from you. You have all the source code. Feel free to look at it. That's why you have it.

liudr

This def is not very useful to you unless you write libraries for arduino 0022 and 1.0+
I believe there are also time and dates, a bit more useful to you.

Zadaz

"You have all the source code. Feel free to look at it. That's why you have it."

Are you serious? I have looked at the source. It's 1830 files in at least 4 different languages for at least 4 different platforms. There are hundreds of thousands of lines of code to look through.

Would you care to give me the slightest hint about where in the source I should investigate?

Coding Badly


The entire source code for the "core" is in {ArduinoRoot}/hardware/arduino/.  You can browse online here...

https://github.com/arduino/Arduino/tree/master/hardware/arduino

The majority of the code is in {ArduinoRoot}/hardware/arduino/cores/arduino/ ...

https://github.com/arduino/Arduino/tree/master/hardware/arduino/cores/arduino

Coding Badly


The ARDUINO constant is injected by the IDE.  Turn on verbose output / compiler to see how.

guix


"You have all the source code. Feel free to look at it. That's why you have it."

Are you serious? I have looked at the source. It's 1830 files in at least 4 different languages for at least 4 different platforms. There are hundreds of thousands of lines of code to look through.

Would you care to give me the slightest hint about where in the source I should investigate?


Use something like Notepad++ which allow to search for text in all files in a folder...

Go Up