PrgmrArduino
PrgmrArduino is an Arduino library written in C++ that provides the foundation for implementing an NMRA DCC programmer. PrgmrArduino presents classes and methods for configuring a locomotive’s address, direction of travel, lights and sounds, and so on. PrgmrArduino translates these commands into DCC packets. An interrupt service routine attached to Timer2 takes these packets and generates a precision DCC waveform generated on digital pin 11 and digital pin 3. This signal is suitable for amplification with a small h-bridge circuit. Please note that the Arduino outputs are not themselves capable of driving trains directly.
To read configuration data, PrgmrArduino requires some way of measuring the current draw from the h-bridge or booster. You may use any suitable means at hand; a current-sense resistor and cheap op-amp will usually do the trick. I will post sample schematics at a later time. The output of the current-sense circuitry must be an analog voltage in the range 0-5VDC, and wired to the Arduino’s analog pin 3 (configurable in software).
PrgmrArduino is fully open-source software, and is released under the terms of the GPL. PrgmrArduino is inspired by, and parts derived from, code written by Wolfgang Kufer.
More detailed documentation is currently pending, although the code does include an example sketch to demonstrate usage.
You can download PrgmrArduino from github; bug reports, contributions of code are welcome. Please do leave a note if you use PrgmrArduino in your project.
Please note that at this time PrgmrArduino is beta software, and is not feature complete.
PrgmrArduino is the perfect complement for Io:duino, and Arduini-compatible DIY DCC and OpenLCB development board.

Woohoo! Been waiting for this. Just the think to kick my lazy but back into gear.
I am not getting a squarewave.
Mr Cool, could you say more? Currently, the library is in a barely working state, so there are lots of places where something could go wrong. But, unlike the main line output of CmdrArduino, PrgmrArduino only outputs a signal when there is a command being sent, otherwise it turns the output off. So, normally, you shouldn’t see a square wave at all. If you connect an O’Scope to the outputs, and run the demo program, you should see a very brief square wave, followed by nothing, as it simply sends a command to program CV29 to 6, then shuts off the outputs.
I’d be happy tot test it for you, because i’m not able to get my Kuehn WD10 to work, without programming it first
But.. Ive connected my booster to pin 2 of the Duemilanove, and cant see any please to fix this in yout code (i’m not much of a cpp programmer).
Don, its mrpig from the jns forum.
It would be great if you could develop a cct that can read an FL4 without having to put a 100 ohm resistor across one of the function outputs.
This would be handy to read all the cab cars back into jmri when you were to, say, accidentally lose the entire jmri roster (oops).
The current draw from just a couple of leds is not enough to register on my digitrax system for readback.
Gordon, an interesting idea, but the resulting product would likely not be able to read decoders with a full load across them (too much noise). It would be quite specialized indeed! Better perhaps to design a product that sits between the carriage and the programmer that amplifies the current draw of the FL4, perhaps?
That would probably be a more universal solution. Sort of the opposite of the soundtraxx programming booster. I would be willing to bet more than a few jns members would be interested in such a device. Would sure beat programming blind.
I tried a very dumbed down approach along your idea. Tried laying various resistors from 75 to 1k across the tracks hoping it would get close to the threshold for the command station to register an ack. The led’s still flashed but the cs still didn’t register it.