diff --git a/src/main.cpp b/src/main.cpp index a7fefc8..9c079af 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,17 +4,23 @@ #define DCC_IRQ_MICROSECONDS 29 +#if defined(ARDUINO_AVR_UNO) +#define NUM_LOCOS_MAIN 20 +#else +#define NUM_LOCOS_MAIN 50 +#endif + //////////////////////////////////////////////////////////////// // Motor driver selection: // Comment out all but the two lines that you want to use -// DCC* mainTrack = DCC::Create_WSM_SAMCommandStation_Main(50); +// DCC* mainTrack = DCC::Create_WSM_SAMCommandStation_Main(NUM_LOCOS_MAIN); // DCC* progTrack = DCC::Create_WSM_SAMCommandStation_Prog(2); -DCC* mainTrack = DCC::Create_Arduino_L298Shield_Main(50); +DCC* mainTrack = DCC::Create_Arduino_L298Shield_Main(NUM_LOCOS_MAIN); DCC* progTrack = DCC::Create_Arduino_L298Shield_Prog(2); -// DCC* mainTrack = DCC::Create_Pololu_MC33926Shield_Main(50); +// DCC* mainTrack = DCC::Create_Pololu_MC33926Shield_Main(NUM_LOCOS_MAIN); // DCC* progTrack = DCC::Create_Pololu_MC33926Shield_Prog(2); //////////////////////////////////////////////////////////////// @@ -34,7 +40,7 @@ void SERCOM4_Handler() void setup() { mainTrack->hdw.setup(); progTrack->hdw.setup(); - + // TimerA is TCC0 on SAMD21, Timer1 on MEGA2560, and Timer1 on MEGA328 // We will fire an interrupt every 29us to generate the signal on the track TimerA.initialize();