Go Down

Topic: (SOLVED) Pragma Compiler Directives for IDE 1.0 (Read 1 time) previous topic - next topic

Jan 26, 2012, 06:15 pm Last Edit: Jan 31, 2012, 03:53 pm by jvaughters Reason: 1
I was wondering if anyone has come up with some pragma compiler directives, so we can write or modify old code without maintaining multiple versions of the code that we write. I have searched this forum, with no luck. But as with all Forums, it is hard to find information sometimes. I think if we could solve this issue, the community could be informed how to write code more efficiently to cover both streams.

For instance, the wire library has changed some methods, and I would like my #defines to be able to identify and change the code for both the old and new methods using pre-compiler directives, possibly through pragma data.

Any other suggestions on how to handle this issue are also welcome.

Thanks in advance for your advice.


something like:

#if ARDUINO >= 100
    #include <EthernetUdp.h>
    #include <UDP.h>

#if ARDUINO >= 100
    #include "Arduino.h"
    #include "WProgram.h"
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Jan 31, 2012, 03:56 pm Last Edit: Jan 31, 2012, 03:58 pm by jvaughters Reason: 1
Thanks for the reply, I also have seen this type, but have not tried yours or this yet, but I know this will solve the issue. It was the ARDUINO value I needed to be able to create Pre-Complier solutions.

// Arduino 1.0 compatibility
#if defined(ARDUINO) && ARDUINO >= 100
    #include "Arduino.h"
    #include "WProgram.h"

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131