07-16-2015 03:59 PM
Just remember, you can use as many states as you need to. There is no limit...at lest I haven't reached yet.
If I could offer some of my novice advice - currently, on your Initialize state, your doing some things then waiting on a button press or a value change in the same event. That is not how a state machine is supposed to work. I'd generarte another state - call it "Wait on Event' state. That way, when a button press happens (for example), you can execute your code in the state(s) that it needs to do, then come back to the "Wait on Event" state or do somethig after so many milliseconds in the "Timeout" state if you need to. Each states code should be small, I'd say no more than a monitor width (even less if you can handle it) so it's maintainable and flexable as well.
We can all assist you here. Don't be afraid to reach out to us. We're all here to share our knowledge and help. We were all beginners at some point. 🙂
07-16-2015 04:03 PM
Eric,
Thanks for the advice. For step one i will try to get everything into one screen width. Ill see if i can clean this up at all and make it a little easier to see whats happening. I know i have a few shift registers i dont need as well. i also had a bunch of coersions that i have been removing with number conversions.
Ill see what i can do and then repost it and see if there are anymore comments on cleaning it up.
I appreciate all the help,
Matt