LocoIO Dies is a simple demonstration of how some LocoIO facilities could be used, in particular to control all ports of LocoIO with a single command. This feature is available in LocoIO since version 1.3.3.
The demo is a pair of electronic 'dies', with two 7-segment displays. The dies are 'thrown' under control of a PC program by pushing buttons. The displays and push buttons are mounted on a daughter board, connected to LocoIO via a flat cable.
The schematics of the daughter board are below.
The scheme is pretty straight forward. The activation switches are connected to the first 2 ports of LocoIO. The 14 display segments to the remaining ports. The decimal points of the 7-segment displays light up when a key is pressed, directly wired on the daughter board, not controlled by the application program.
As you can see the daughter board has not only the components for its primary function, but also a connection to a parallel port. This makes it possible to program LocoIO 'through' this board. For details about this method of programming see the program 'Jisp' in the Java programming directory of LocoNet_Hackers Files section. The diodes 1N4148 protect the LPT port and also make sure that the activation switches work even when a parallel port is connected. The 12K resistors prevent current flow to the DP LEDs from the parallel port during programming.
A possible experimental component arrangement on strip-board could look like the picture below:
A sample program to handle this 'LocoIO Dies' daughter board of LocoIO is
provided in LioDies.C.
This program reacts on LocoNet messages generated by LocoIO as result of
activity of the daughter board switches.
During the time a key is pressed it displays random digits on the
corresponding 7-segment display (about 8 digits per second).
Of course the program will also react on the same messages generated by
other LocoNet equipment, like normal turnout control hardware or other
software.
The 'dies' in this program have 10 faces with digits 0..9.
This can be changed easily into 6 faces for regular dies with digits in the
range 1..6 (the required change is already indicated in the source).
The program is written in C-language and the source contains details about the required LocoIO CV configuration and comments abouts its internal working. The file LioDies.Hex provided with this package can be used to load the required CV-setting for LocoDies with a PIC programmer, for example Jisp.
The executable LioDies.Exe can be started from a commandline under OS/2.
It does not expect any parameters, but assumes that a LocoBuffer, jumpered
for 19200 bps and connected to COM1, is being used as the interface to
LocoNet.
LocoDies.Exe requires the LocoNet API libraries for OS/2.
These are downloadable from the LocoNet_Hackers mailing list in the LocoNet
API directory in the Files section.
For other platforms than OS/2 probably minor changes will be needed in
the LioDies source.
But I'm afraid nobody followed my example to build an equivalent of the
LocoNet packet layer API for other platforms!