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: ps: Because I can't manage the codeplex issues list and modify answers we REALLY do need to use the VM forum for all discussions. It is important that we keep things clear for other users and this system is impossible!! Thanks

Viewing all articles
Browse latest Browse all 373

Trending Articles



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