DCCpp
This is the library version of a program for Arduino to control railroading DCC devices.
Common Configuration Lines

This is the 'begin' lines for some common configurations. Note that for LMD18200, the two final arguments must be adapted to your need... The wiring for these configurations is visible here : http://www.locoduino.org/spip.php?article187 . The text is in French, but schema can be understood !

For Arduino or Pololu shields, signalPinMain must be connected to Direction motor A, and signalPinProg to Direction motor B If a track is not connected, main or programming, the signalPin should stay to default at 255 (UNDEFINED_PIN). For H bridge connected directly to the pins, like LMD18200, signalPin and Direction motor should have the same pin number, or directions can be set to UNDEFINED_PIN.

Arduino Uno + LMD18200 + MAX471
DCCpp::beginMain(UNDEFINED_PIN, DCC_SIGNAL_PIN_MAIN, 3, A0);
Arduino Uno + 2 LMD18200 + 2 MAX471
DCCpp::beginMain(UNDEFINED_PIN, DCC_SIGNAL_PIN_MAIN, 3, A0);
DCCpp::beginProg(UNDEFINED_PIN, DCC_SIGNAL_PIN_PROG, 5, A1);
Arduino Mega2560 + LMD18200 + MAX471
DCCpp::beginMain(UNDEFINED_PIN, DCC_SIGNAL_PIN_MAIN, 3, A0);
Arduino Mega2560 + 2 LMD18200 + 2 MAX471
DCCpp::beginMain(UNDEFINED_PIN, DCC_SIGNAL_PIN_MAIN, 3, A0);
DCCpp::beginProg(UNDEFINED_PIN, DCC_SIGNAL_PIN_PROG, 11, A1);
Arduino Uno or Mega2560 + Arduino Motor Shield
DCCpp::beginMainMotorShield();
DCCpp::beginProgMotorShield();

or

DCCpp::beginMain(MOTOR_SHIELD_DIRECTION_MOTOR_CHANNEL_PIN_A, DCC_SIGNAL_PIN_MAIN, MOTOR_SHIELD_SIGNAL_ENABLE_PIN_MAIN, MOTOR_SHIELD_CURRENT_MONITOR_PIN_MAIN);
DCCpp::beginProg(MOTOR_SHIELD_DIRECTION_MOTOR_CHANNEL_PIN_B, DCC_SIGNAL_PIN_PROG, MOTOR_SHIELD_SIGNAL_ENABLE_PIN_PROG, MOTOR_SHIELD_CURRENT_MONITOR_PIN_PROG);
Arduino Uno or Mega2560 + Pololu MC33926 Motor Shield
DCCpp::beginMainPololu();
DCCpp::beginProgPololu();

or

DCCpp::beginMain(POLOLU_DIRECTION_MOTOR_CHANNEL_PIN_A, DCC_SIGNAL_PIN_MAIN, POLOLU_SIGNAL_ENABLE_PIN_MAIN, POLOLU_CURRENT_MONITOR_PIN_MAIN);
DCCpp::beginProg(POLOLU_DIRECTION_MOTOR_CHANNEL_PIN_B, DCC_SIGNAL_PIN_PROG, POLOLU_SIGNAL_ENABLE_PIN_PROG, POLOLU_CURRENT_MONITOR_PIN_PROG);