Need help with turning this idea into a flow code

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
User avatar
Emadex3
Posts: 9
Joined: Sat Apr 28, 2018 7:43 pm
Location: Home
Has thanked: 5 times
Contact:

Need help with turning this idea into a flow code

Post by Emadex3 »

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 !

EtsDriver
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

Post by EtsDriver »

What have you allready tried? Could you post your flowchart?
Ill just keep the good work up!

User avatar
Emadex3
Posts: 9
Joined: Sat Apr 28, 2018 7:43 pm
Location: Home
Has thanked: 5 times
Contact:

Re: Need help with turning this idea into a flow code

Post by Emadex3 »

EtsDriver wrote:What have you allready tried? Could you post your flowchart?
I have tried some but all failed due to the processor not being able to register the push from the "push to make button"
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.

User avatar
Steve
Matrix Staff
Posts: 3418
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

Post by Steve »

This kind of problem can be solved using a state machine. Some examples are here:

https://www.matrixtsl.com/wikiv7/index. ... ateMachine

User avatar
Emadex3
Posts: 9
Joined: Sat Apr 28, 2018 7:43 pm
Location: Home
Has thanked: 5 times
Contact:

Re: Need help with turning this idea into a flow code

Post by Emadex3 »

Steve wrote:This kind of problem can be solved using a state machine. Some examples are here:

https://www.matrixtsl.com/wikiv7/index. ... ateMachine
is there is a v5 for the fcfx files ?, if so please provide me a link
You've already done a lot for me , THANK YOU !

User avatar
Steve
Matrix Staff
Posts: 3418
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

Post by Steve »

No, I do not have a specific v5 program, but using your example:
Emadex3 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_0 would be the starting state. Pressing input 1 (A) would move to STATE_1

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.

Post Reply