Quantcast
Channel: Arduino for Visual Studio and Atmel Studio
Viewing all articles
Browse latest Browse all 373

Commented Issue: Wrong ARDUINO version defined [65]

$
0
0
I have code that uses the ADUINO define to distinguish between arduino 1.x and previous versions. That is eesential as the one uses Arduino.h and the other WProgram.h as a central include.

Unfortunately the VisualMicro addon defines ARDUINO as 10 and so the conditional defines in standard arduino code fail. Then WProgram.h is included instead of Arduino.h.

Code example:

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

The above will use WProgram.h if compiled with VisualMico as ARDUINO is defined as 10 and not 100.

See also arduino release notes: http://arduino.cc/en/Main/ReleaseNotes


Comments: I now also tested with Arduino 1.0.3 IDE and get the same problem. ...vsarduino.h generated by VisualMicro always has #define ARDUINO 10 that will not work with standard arduino code. Arduino 1.0.3 uses "-DARDUINO=103"

Viewing all articles
Browse latest Browse all 373

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>