Notifications
Clear all

4 Way Crossing Polarity

62 Posts
5 Users
1 Likes
18.8 K Views
(@john40131)
Member
Joined: 5 years ago
Posts: 95
Topic starter  

@zeferby

I'll watch that last video you posted, just a few things that I would like to clarify.

I will change the SPST switches used on (trackswitch) to momentary push buttons.

The #ifdef CROSSING_NOHARD do ALL of them need // uncommenting or just line 226, 233 and 239.

I will have another look tomorrow and try and tell you what the output pins and try and workout why a (trackswitch) is not giving a HIGH output on pins 11 to 15, also the only output on pins 1 to 10 is pin 1 which is HIGH but occasional flips to LOW and back to HIGH all the others stay LOW, but on Serial monitor they switch from LOW to HIGH except ( 1 ) which is HIGH and wont go LOW.

Regards John

 


   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 
Posted by: @john40131

The #ifdef CROSSING_NOHARD do ALL of them need // uncommenting or just line 226, 233 and 239.

Actually what you want to comment (just add // in front) is only the line with #define CROSSING_NOHARD macro at the beginning of the sketch : then all the lines with #ifdef CROSSING_NOHARD will find that the symbol is NOT defined, so they will "activate" their #else...#endif block of code.

Eric


   
ReplyQuote
(@john40131)
Member
Joined: 5 years ago
Posts: 95
Topic starter  

I commented out the #ifdefine CROSSING_NOHARD at line 43 but came with error on line 45 #endif if I comment that out no errors is that correct..

John


   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 

@john40131

No John, do not comment the #ifdef's, but do comment the initial #define CROSSING_NOHARD , which should be at line 38

Eric


   
ReplyQuote
(@john40131)
Member
Joined: 5 years ago
Posts: 95
Topic starter  

@zeferby

Yeh done, sorry I miss read your original message, was okay no errors, will have a try later as shopping this PM till about 4,00pm..

John


   
ReplyQuote
(@john40131)
Member
Joined: 5 years ago
Posts: 95
Topic starter  

@zeferby

Just a quick try before having dinner, uploaded as per pic, all trackswitch pins are HIGH, All frog polarities are HIGH but frog1A goes LOW every 10 secs as LED on Mega flashes then goes back HIGH,

Track switching has no effect on trackswitch pin outputs ...

Track switch pic

 


   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 

@john40131

Hum, I'm sorry I misled you >in this post< : I managed push-button temporary switches in another sketch (using some PCF8574's) and the rail_crossings_sample2_V2.ino sketch actually stayed with basic switches...

Beware I defined the 5 switch pins as INPUT_PULLUP (lines 143-147), so depending on your wiring you may need to adapt that ?

Eric


   
ReplyQuote
(@john40131)
Member
Joined: 5 years ago
Posts: 95
Topic starter  

@zeferby

Yes I have used pins 20 thro to 24 also has you have defined in lines 143 to 147 and as its a pullup I ground this pin, at the moment all switches are open so all 5 inputs are HIGH, I am going to change to momentary switches later this afternoon just need to remove SPST and fit pushbuttons.

John

Just a thought I use Messenger a lot i.e facebook messenger if would be easier can search for me..can send you pictures as well.. picture of (small dog with toy in mouth). John Marshall.

This post was modified 4 years ago 2 times by John40131

   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 

@john40131

Sorry, I don't touch facebook, linked-in, twitter, and other such "social" thingies.

 

Eric


   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 

@john40131

Hi john, if you want to setup a connection to the small discord server i have setup, the following link will be available for the next 6 hours (and then it will expire) : https://discord.gg/FDuruQ

Also I'm available from now until 8.30pm my time, which is 7.30pm UTC

 

Eric


   
ReplyQuote
(@john40131)
Member
Joined: 5 years ago
Posts: 95
Topic starter  

@zeferby

Hi Eric sorry I missed your posts, leave till Saturday for 2.00pm as all family going out so no distractions..

One thing you could look at why trackswitch 1 thro to 5 is not having any response on Mega output or what do I need to look for to change..

20191218 135253

 

John

 


   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 
Posted by: @john40131

Hi Eric sorry I missed your posts, leave till Saturday for 2.00pm as all family going out so no distractions..

No worry John, if you are around and want to setup before saturday, just ping me with an @-mention.

Posted by: @john40131

One thing you could look at why trackswitch 1 thro to 5 is not having any response on Mega output or what do I need to look for to change..

I guess we'll make a small test script to check that

Eric


   
ReplyQuote
(@john40131)
Member
Joined: 5 years ago
Posts: 95
Topic starter  

@zeferby

Hi Eric I was just a quick update which may help to fault find,

When I run the program with Serial Monitor I can see that "Switch States" line change's from 1 to 0 when I press Point buttons or switch the SPST switch for any 1 thro 5 i.e 1,1,0,1,1 for 3 etc the "Track States" always stay at 1 except as below, on each pass of a point on the loop you have a 1 second delay between each point and the 1A track position goes from HIGH to LOW for a fraction of a second each time none of the others change and that is with all points outputs HIGH..

One other thing if I switch point 5 so "Switch State" on  serial monitor goes LOW i.e 1,1,1,1,0 and "Track States" goes LOW after next pass i.e 1,1,1,1,0 but none of the other "Track States" change when switched...

But no outputs to switch point pins 11,12,13,14,15 all stay HIGH...

Hope this helps..

Regards John

This post was modified 4 years ago 2 times by John40131

   
ReplyQuote
(@zeferby)
Member
Joined: 5 years ago
Posts: 355
 

@john40131

Hi John, here is a new invite link, valid for the next 6 hours : https://discord.gg/2Dzyph

Eric


   
ReplyQuote
(@john40131)
Member
Joined: 5 years ago
Posts: 95
Topic starter  

@zeferby

Its Okay Eric I will leave till Saturday, was just having a quick test and fault find, got a bit late know..

John


   
ReplyQuote
Page 4 / 5