Pages: [1]   Go Down
Author Topic: What's is the ARDUINO constant telling me?  (Read 287 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I run this bit of code:

Code:
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.)
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 611
Posts: 49092
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7189
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"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?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12861
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12861
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

France
Offline Offline
Edison Member
*
Karma: 37
Posts: 1006
Scientia potentia est.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"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...
Logged

Pages: [1]   Go Up
Jump to: