-->
Page 1 of 2

Use SW to determine which Arduino version I'm running.....

PostPosted: Sat Mar 12, 2016 7:34 pm
by xtal
Is there any way to use ESP Arduino Software to detect what Arduino version the sketch
was compiled with?

Re: Use SW to determine which Arduino version I'm running...

PostPosted: Sun Mar 13, 2016 4:46 am
by PaulRB
Sounds like an "XY problem" to me!

Paul

Re: Use SW to determine which Arduino version I'm running...

PostPosted: Sun Mar 13, 2016 5:31 am
by krzychb
Hi xtal,

To detect what Arduino version the sketch was compiled with you can check ARDUINO constant.

Sample sketch:
Code: Select allvoid setup()
{
  Serial.begin(115200);
  Serial.println();
  Serial.print("The 'ARDUINO' constant contains: ");
  Serial.println(ARDUINO);

  if(ARDUINO == 10608)
  {
    Serial.println("You are running Arduino IDE 1.6.8");
  }
}

void loop() {}


Output on serial monitor:
Code: Select allThe 'ARDUINO' constant contains: 10608
You are running Arduino IDE 1.6.8


Krzysztof

Re: Use SW to determine which Arduino version I'm running...

PostPosted: Sun Mar 13, 2016 8:23 am
by xtal
Thanks Krzysztof I'll give it a try...