Crossing Bell Sound Board Controller

westaust55

Moderator
As you say, it is working, and if that provides the functionality you want then all is well.

It is not mandatory to include a #PICAXE directive in your program listing –not this is only used by the Programming Editor and not downloaded into the PICAXE chip.
Some folks suggest it should be mandatory however I am happy to know through a comment included in the first lines of the program listing.

Some futher suggestions about your posted program listing:
1. For a short program consider just embedding the code within post between [code] and [/code] tags so it is more redily visile. Some readers don’t want to bother with opening an attachment to view a program. If you are not on a PC with the PE installed you need to associate .bas files with Notepad which some readers may not wish to do.
2. recommend that you do not include line numbers in the program comments. They are unnecessary and what happens it you add an additional line, takes time to renumber all the comment.
3. where you have a test for the status of a pin, it can only be 0 or 1. So instead of
IF pin3 <> 0 THEN . . .
just test with
IF pin3 = 1 THEN

4. try indenting the actual program commands so there are only labels starting at the first column in any line.. When there is a looping structure using IF&#8230;THEN or FOR&#8230;NEXT or DO&#8230;LOOP, etc further indent the code within the loop.

5. Since you are using a newer M2 part, you should use the port.pin nomenclature as explained in the PICAXE manuals when identifying PICAXE IO pins. This helps to distinguish that you are using a newer M2 or X2 part and not an older part where many pins were pre defiend by the firmaware as either inputs, outputs but not able to be both (with some exceptions).


While none of the above is mandatory, it is highly recommended and if you start doing this from the begging it is easier later when you create longer program listings and makes it far easier for you and others who may be asked for help to understand the program flow.

With respect to you particular project I note that you are controlling just the sound. What is controlling the mentioned boom gates?
There was a few months ago another model railway project where the poster developed a PICAXE project to detect a train in either direction and operate the boom gates until the train had completely past. It may be worth your doing a PICAXE forum search to see what others are/have done in your area of interest.
 

alhoop

Member
With respect to you particular project I note that you are controlling just the sound. What is controlling the mentioned boom gates?
There was a few months ago another model railway project where the poster developed a PICAXE project to detect a train in either direction and operate the boom gates until the train had completely past. It may be worth your doing a PICAXE forum search to see what others are/have done in your area of interest.
Westy:
Thanks for all your suggestions. I learned some of that in college - 40 plus years ago.
The line numbers are for possible publication purposes. I had an article published in N-Scale magazine Nov/Dec 2010 using the Picaxe 20M and
wish I had included line numbers in the program. BTW if you look it up I didn't use 3 lines to read 2 BCD switches as recommended here.

The gates are controlled by a project that appeared in Model Railroader July 1989 page 70 and that part has been working for over twenty years.
I recently added a HQ300 crossing bell sound board from Innovative Train Technology Products which gives a bell sound for 60 seconds or continuously until power is removed.
I wanted the bell sound to end as soon as the gates are down - 7 seconds in my case - so I'm using the 08M2 to remove power to the sound board after 7 seconds.

Most of the crossing gate bells in th US stop as soon as the gates are down - it didn't use to be that way - I can remember as a passenger I could hear the bells still ringing as we went through the crossing. Same in the old movies. How do they work in the UK and AUS? Does the UK use crossing bells or just manually moved fences. From all the train rides I took on the Continent I can't ever rember hearing a bell, just seeing the fence gates.

Alvin Hooper
 
Last edited:

rossko57

Senior Member
How do they work in the UK
Automated crossings have beepers these days, silenced once full barriers are down; there are lights (sometimes including itty-bitty ones to the side for pedestrians) that continue to flash while the rise and fall barriers are down.
http://www.youtube.com/watch?v=SMydaNVRO3A

Rural crossings with half-barriers beep throughout, or with no barriers bell throughout.
http://www.youtube.com/watch?v=BdvtCwAOQGQ
These are being phased out slowly, as they've proved unable to eradicate idiot road users faster than new idiots appear.

Hardly any steam era swing gates left now. They usually had no bells, on the basis that the operator was alongside in his box and could shout out the window .....
http://www.youtube.com/watch?v=vZZvyLkEHqk
 

westaust55

Moderator
In Australia from my travels, very few manual gates - only one set at Victor Harbour in SA come to mind.
Most automated crossings have bells and main lights on post and smaller lights on booms which all operate from time approaching train is detected until a train completely clears the crossing. Booms are only the width of the approaching lanes for a given side - ie half the total roadway width.
 

SD70M

Senior Member
Rural crossings with half-barriers beep throughout, or with no barriers bell throughout.
These are being phased out slowly, as they've proved unable to eradicate idiot road users faster than new idiots appear.
Glad I'm not the only one thinking this.

Booms are only the width of the approaching lanes for a given side - ie half the total roadway width.
Yeah, we can't have half-width booms in the UK, See above :)

Angie
 
Top