16 #define UNDEFINED_PIN 255 23 #define MAX_MAIN_REGISTERS 12 25 #define MAX_PROG_REGISTERS 3 32 #ifdef ARDUINO_AVR_MEGA // is using Mega 1280, define as Mega 2560 (pinouts and functionality are identical) 33 #define ARDUINO_AVR_MEGA2560 36 #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO) // Configuration for UNO or NANO 39 #define DCC_SIGNAL_PIN_MAIN 10 // Arduino Uno - uses OC1B 41 #define DCC_SIGNAL_PIN_PROG 5 // Arduino Uno - uses OC0B 43 #elif defined(ARDUINO_AVR_MEGA2560) 45 #define DCC_SIGNAL_PIN_MAIN 12 // Arduino Mega - uses OC1B 46 #define DCC_SIGNAL_PIN_PROG 2 // Arduino Mega - uses OC3B 55 #define MOTOR_SHIELD_SIGNAL_ENABLE_PIN_MAIN 3 56 #define MOTOR_SHIELD_SIGNAL_ENABLE_PIN_PROG 11 58 #define MOTOR_SHIELD_CURRENT_MONITOR_PIN_MAIN A0 59 #define MOTOR_SHIELD_CURRENT_MONITOR_PIN_PROG A1 61 #define MOTOR_SHIELD_DIRECTION_MOTOR_CHANNEL_PIN_A 12 62 #define MOTOR_SHIELD_DIRECTION_MOTOR_CHANNEL_PIN_B 13 64 #define POLOLU_SIGNAL_ENABLE_PIN_MAIN 9 65 #define POLOLU_SIGNAL_ENABLE_PIN_PROG 11 67 #define POLOLU_CURRENT_MONITOR_PIN_MAIN A0 68 #define POLOLU_CURRENT_MONITOR_PIN_PROG A1 70 #define POLOLU_DIRECTION_MOTOR_CHANNEL_PIN_A 7 71 #define POLOLU_DIRECTION_MOTOR_CHANNEL_PIN_B 8 84 static uint8_t EthernetIp[4];
85 static uint8_t EthernetMac[6];
86 static int EthernetPort;
87 static EthernetProtocol Protocol;
90 static byte SignalEnablePinMain;
91 static byte CurrentMonitorMain;
93 static byte SignalEnablePinProg;
94 static byte CurrentMonitorProg;
97 static byte DirectionMotorA;
98 static byte DirectionMotorB;