Define for Arduino version?

Is there a #define setup for the Arduino version that is in use. Sort of like DATE or TIME?

I'm using 0023 at the moment and so I did a

find . -name *.h -print -exec fgrep 0023 {} ;

and came up with nothing.

yes, ARDUINO is defined - it's 22 for 0022 (and 0023 I think...) and 100 for 1.0

It's defined by the IDE at compile time (if you do the verbose setting, you'll see g++ ... -DARDUINO=100 ..., which sets that variable)

Let's find out...

  • Start the Arduino IDE
  • Load or enter a simple sketch
  • Hold the Shift key and click the Verify button

The compiler command-line is output in the Status Window. From Arduino 0022...

C:\Arduino\arduino-0022\hardware\tools\avr\bin\avr-g++ -c {snip} -DARDUINO=22 {snip}

Good question. I unfortunately don't have an answer. So I replied in order to be reminded when someone replies with a real answer :wink:
Thanks to both Coding badly and WizenedEE, you answered quicker than I can thumb my first two sentences on my phone.

Great!

The ARDUINO define works.

Thanks...