Software



I have 3 software versions.

You can get the first version here:

1. A crude version but it works. NOTE: I started to program for 4 computers.
I created a loop that scans all the inputs and timers. When one input is triggered, a subroutine is called. When a coin is dropped in one of the inputs(13,14,15,16) is triggered. A subroutine add's an amount of credits to a variable. When a button is pushed, these credits are transferred to a computer variable, a timer is started, and a output (1,2,3,4) is set to "1"When the timer stops, it's restarted again and one credit is subtracted. When credits are 0 the timer does not restart and the corresponding output (1,2,3,4) is set to "0"
The first 8 I/O 's are outputs. I only need 4, but used the other 4 for timer debugging. The next 4 I/O 's are inputs for the push buttons. The last 4 I/O 's are coin inputs. Some times one monitor did not got disconnected. This was due to timer collision. When 2 timer stop at the same time. The timers are restarted again. Starting 2 timers at the same time will not work. One timer kills the other, and when the timer is killed the monitor does not get disconnected anymore. So I introduced a watchdog timer. There is 1 DA output, this was used to control an old VU meter. To indicate how much money was put in.

The second version

2. I was still working on the problem with the timer colission at this time, but I introduced extra VU meters. For this I used a mono led VU meter from velleman. Ripped off the little IC to make it work for me. Connected the DA output to the VU meter. This way I made a time indicator. When all the leds are on, this indicates that thare is 15 minutes or more time left. As the leds on the VU meter fadeout, time is decreasing. Programming for the VU meter was trickey. I had to introduce an offset, to let the first led lightup when a small amount of money is dropped in. But an VU meter overflow subroutine was needed for when loads of money is droped in. If you realy are looking into the source you'll notice I created a maintenance key input.

The third version.

You'll notice I solved the timer collision problem with watch dog timers. (More later)

Extra's

Back

Index