Skip to content

Commit

Permalink
fixed: require a user to uncomment a line in the code to select the a…
Browse files Browse the repository at this point in the history
…rduino board, relying on compiler mcu defines sucks, since they can change when new arduino boards are made
  • Loading branch information
[email protected] committed Jan 9, 2012
1 parent 651a4f7 commit d54cb20
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions arduino/boblight_arduino_pwm/boblight_arduino_pwm.pde
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,23 @@ void setup()
Serial.begin(38400);
}

//uncomment one of the lines below to match your arduino
//#define DUEMILANOVE
//#define MEGA

//this could be done automatically, but then I have to check
//if newer arduino boards are released etc etc, meh (I tried, it sucked)

//on the Arduino megam, 12 pwm outputs are available, on the duemilanove there are 6
#ifdef __AVR_ATmega1280__
#ifdef MEGA
//mega
uint8_t outputs[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
#else
#elif defined(DUEMILANOVE)
//duemilanove
uint8_t outputs[] = {3, 5, 6, 9, 10, 11};
#else
#error please uncomment a line matching your arduino board (you're actually required to edit the code now)
uint8_t outputs[] = {0};
#endif
#define NROUTPUTS (sizeof(outputs))
Expand Down

0 comments on commit d54cb20

Please sign in to comment.