suppose there are 4 inputs that are "push to make" buttons:
input 1 will have the variable "A" assigned to it
input 2 will have the variable "B" assigned to it
input 3 will have the variable "C" assigned to it
input 4 will have the variable "D" assigned to it
I want to be able to get an output that follows the inputs but in order , Example :
I press input 1 than input 2 than input 1 ------> output 1 (ABA = output 1 )
I press input 1 than input 3 than input 2 ------> output 2 (ACB = output 2 )
( the output follows the order in which inputs where given)
any general idea on how to apply this I will be really gratful
I really appreciate your help !
Need help with turning this idea into a flow code
Moderator: Benj
-
- Posts: 444
- Joined: Tue Apr 15, 2014 4:19 pm
- Location: Kajaani, Finland
- Has thanked: 345 times
- Been thanked: 227 times
- Contact:
Re: Need help with turning this idea into a flow code
What have you allready tried? Could you post your flowchart?
Ill just keep the good work up!
Re: Need help with turning this idea into a flow code
I have tried some but all failed due to the processor not being able to register the push from the "push to make button"EtsDriver wrote:What have you allready tried? Could you post your flowchart?
please note that it has to be a push to make button
today I've been browsing my old flowcode charts and came across this one as I think I may be able to use it for my purpose, it is a flowchart for door lock but it was very large and thus unpractical (flowcode v3 was used to make this one)
my idea is to register every button click the same way as in this doorlock chart.
- Steve
- Matrix Staff
- Posts: 3424
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: Need help with turning this idea into a flow code
This kind of problem can be solved using a state machine. Some examples are here:
https://www.matrixtsl.com/wikiv7/index. ... ateMachine
https://www.matrixtsl.com/wikiv7/index. ... ateMachine
Re: Need help with turning this idea into a flow code
is there is a v5 for the fcfx files ?, if so please provide me a linkSteve wrote:This kind of problem can be solved using a state machine. Some examples are here:
https://www.matrixtsl.com/wikiv7/index. ... ateMachine
You've already done a lot for me , THANK YOU !
- Steve
- Matrix Staff
- Posts: 3424
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: Need help with turning this idea into a flow code
No, I do not have a specific v5 program, but using your example:
STATE_1 would be when A is pressed. In this state, pressing "B" would move to STATE_2, and pressing "C" would move to STATE_3. Pressing something else would probably reset to STATE_0 (although you might want a press of "A" to automatically move to STATE_1).
STATE_2 would be when "A" then "B" has been pressed. Pressing "A" again from this state should cause "output 1" to fire. Pressing something else would probably reset to STATE_0.
STATE_3 would be when "A" then "C" is pressed. Pressing "B" from this state would trigger "output 2".
To create a program for this, you'd need to keep track of a variable for "state" that moves between the different states when the appropriate input has occurred.
STATE_0 would be the starting state. Pressing input 1 (A) would move to STATE_1Emadex3 wrote: I press input 1 than input 2 than input 1 ------> output 1 (ABA = output 1 )
I press input 1 than input 3 than input 2 ------> output 2 (ACB = output 2 )
STATE_1 would be when A is pressed. In this state, pressing "B" would move to STATE_2, and pressing "C" would move to STATE_3. Pressing something else would probably reset to STATE_0 (although you might want a press of "A" to automatically move to STATE_1).
STATE_2 would be when "A" then "B" has been pressed. Pressing "A" again from this state should cause "output 1" to fire. Pressing something else would probably reset to STATE_0.
STATE_3 would be when "A" then "C" is pressed. Pressing "B" from this state would trigger "output 2".
To create a program for this, you'd need to keep track of a variable for "state" that moves between the different states when the appropriate input has occurred.