Pages: [1]   Go Down
Author Topic: Arduino #define / #if bugs  (Read 1623 times)
0 Members and 1 Guest are viewing this topic.
Maastricht Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: December 11, 2011, 09:34:57 am by avandalen » Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6373
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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)
Logged

Pages: [1]   Go Up
Jump to: