12-03-2015 07:04 PM
Thanks! You have been a HUGE help! I do have one last (hopefully) question. There is a state where I have three choices for the next state so I can't just use a select. Any thoughts on how to go about it? I was thinking of adding another state without a delay as a comparison state? but I'm not sure if that will over complicate things.
12-03-2015 07:11 PM
You can use two selects in a row and run the output of one into the other, or you can have a case statement.
12-03-2015 07:26 PM
12-03-2015 08:27 PM
Another signifcant simplication would be to replace the lighs with radiobutton indicators containing three (or two resp.) LEDs. name the LEDs Red, Yellow & Green (or red & green for the pedenstrian lights) and color the LEDs accordingly. A diagram constant of them is a simple enum with the names of the controls as items, making the diagram much more self-documenting.
Back to the cases where several decisions need to be made at once, you need to make sure that they all execute. e.g. you don't want to skip the pedestrian lights if a left turn got triggered, or vice versa etc. Another option would be to always go through all states but set the wait to zero if one state can be skipped (e.g. if nobody pressed a button).
12-03-2015 08:32 PM - edited 12-03-2015 08:45 PM
Everything appears to be working except for one instance. If the NS Crosswalk buttons (v Cross or ^ Cross) are pressed while the yellow turn arrows are lit then the crosswalk doesn't get triggered.
12-03-2015 08:57 PM - edited 12-03-2015 09:20 PM
IT'S ALIVE!!!
I think it is finally working. Thank you so much for the help everyone! Thanks especially to Altenbach. The internet drinks are on me! 😉
I attached the working file for the curious...
12-03-2015 09:53 PM
Cool. Just for reference, here's how it would look using radiobuttons. Arguably simpler. 😉
(I did not fix the logic according to your latest so that's still broken).