Go Down

Topic: Arduino #define / #if bugs (Read 1 time) previous topic - next topic

avandalen

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.
http://www.avdweb.nl/solar-bike/electronics/pedelec-legalisation-device.html]http://www.avdweb.nl/solar-bike/electronics/pedelec-legalisation-device.html
As you see the code after
#if !ATtiny85
doesn't work as should be.

westfw

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