Go Down

Topic: Arduino #define / #if bugs (Read 2010 times) previous topic - next topic


Dec 11, 2011, 03:31 pm Last Edit: Dec 11, 2011, 03:34 pm by avandalen Reason: 1
Look here for the Pedelec_legalisation_device.pde where I found a bug in the Arduino software. Search for "Arduino bug and you will find.
As you see the code after
#if !ATtiny85
doesn't work as should be.


It's a well-known problem; the preprocessing doesn't understand #directives.  Put a dummy variable an appropriate point in your code and all will be well:
Code: [Select]

char dummy;  // ****** HINT TO Arduino Pre-Processor ******

#define ATtiny85 1

#include <WProgram.h>
#include "PLD.h"

#if !ATtiny85
//#include <TimerOne.h> // comment out for ATtiny85 with // (Arduino bug)
//#include <Flash.h> // comment out for ATtiny85 with // (Arduino bug)

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