Notifications
Clear all

4 Way Crossing Polarity  

Page 4 / 5
  RSS

John40131
(@john40131)
Estimable Member
Joined: 1 year ago
Posts: 100
2019-12-16 7:37 pm  

@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
(@zeferby)
Reputable Member
Joined: 1 year ago
Posts: 380
2019-12-16 7:57 pm  
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
(@john40131)
Estimable Member
Joined: 1 year ago
Posts: 100
2019-12-17 10:04 am  

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
(@zeferby)
Reputable Member
Joined: 1 year ago
Posts: 380
2019-12-17 11:48 am  

@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
(@john40131)
Estimable Member
Joined: 1 year ago
Posts: 100
2019-12-17 12:06 pm  

@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
(@john40131)
Estimable Member
Joined: 1 year ago
Posts: 100
2019-12-17 12:55 pm  

@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
(@zeferby)
Reputable Member
Joined: 1 year ago
Posts: 380
2019-12-17 1:17 pm  

@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
(@john40131)
Estimable Member
Joined: 1 year ago
Posts: 100
2019-12-17 1:45 pm  

@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 10 months ago 2 times by John40131

ReplyQuote
ZeFerby
(@zeferby)
Reputable Member
Joined: 1 year ago
Posts: 380
2019-12-17 4:47 pm  

@john40131

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

 

Eric


ReplyQuote
ZeFerby
(@zeferby)
Reputable Member
Joined: 1 year ago
Posts: 380
2019-12-17 6:26 pm  

@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
(@john40131)
Estimable Member
Joined: 1 year ago
Posts: 100
2019-12-18 1:58 pm  

@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
(@zeferby)
Reputable Member
Joined: 1 year ago
Posts: 380
2019-12-18 6:37 pm  
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
(@john40131)
Estimable Member
Joined: 1 year ago
Posts: 100
2019-12-19 3:33 pm  

@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 10 months ago 2 times by John40131

ReplyQuote
ZeFerby
(@zeferby)
Reputable Member
Joined: 1 year ago
Posts: 380
2019-12-19 4:09 pm  

@john40131

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

Eric


ReplyQuote
John40131
(@john40131)
Estimable Member
Joined: 1 year ago
Posts: 100
2019-12-19 6:03 pm  

@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