How to stop and collect a Keypad Digit

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

How to stop and collect a Keypad Digit

Post by JLeith »

Hello All.
Well at this moment I have not been able to recover my Old Flowcode Design from my failed Laptop Drive.

I was able to find a copy from the forum during past help.

It works 85%. And my mind is running in circles.

I have a Macro call when the Digit "0" is pressed it runs a Reset Macro.
The steps I trying to follow that other programing in my flowcode will not work not work in my new Reset Macro.
I have 4 steps and just focusing on just 1 to work.
Steps.
Press "0"
'0' is routed thru the "Keypad" Macro.
The "0" selection runs Macro Reset.----Works.
Now in Reset I need a selection ?
Press 1 --- Score
Press 3 - Pitch
For some reason beyond my findings I can not get the program to wait for the Selection and then run the little Branch to play a message.
In the future I will do some calculations in the Branch.

Currently when you press "1" it runs off and adds a count to Home team pitch.
I have added my Flowcode.

I know I'm missing a step just can't see it........

John
Attachments
Count Master with Keypad Sept 5 2018.fcfx
(166.45 KiB) Downloaded 208 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: How to stop and collect a Keypad Digit

Post by medelec35 »

Hi John,
Good to see you back on the forums as well.
I have spotted two issues within Keypad macro:
Flowchart issues.png
(31.51 KiB) Downloaded 2067 times
1) You have got a keypad component macro to first detect what key you pressed then another keypad component macro to wait until a key is pressed.

Doing that way around will not detect which key has been pressed.
You need to wait for a key pressed, then detect which key is pressed.

The other issue is never to use a call macro in this case Keypad to call itself!
Use a conditional loop instead.
If you want the loop to run at least once as in this case then select

Code: Select all

Test the loop at the:
End
However, within Keypad function macro, you have got a decision branch:

Code: Select all

If Start = 2
Near the end you have

Code: Select all

Start = 0
then call the Key Keypad function macro.
Start is never going to be 2 at this point, so don't know why you are calling the Keypad function macro again??

Hop this helps you to get further.

I have not checked the rest of the flowchart, just one step at a time.
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: How to stop and collect a Keypad Digit

Post by JLeith »

Thank you Martin

Off to make it happen and refresh my knowledge

John :D

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: How to stop and collect a Keypad Digit

Post by JLeith »

Hello Martin

I tried the steps and for some reason if I removed them the Selection for 2 & 8 won't work.
Keypad.jpg
Keypad.jpg (48.65 KiB) Viewed 4724 times
The action of Start = 2 is activated when the Selection of "5" so the selection of 2 and 8 only appears once.

After this investigation on the Keypad selection the Selection for 5 and 2 or 8 are working.

I'm going back to the Reset macro to do digit capture and see if I can get it to work.

John

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: How to stop and collect a Keypad Digit

Post by medelec35 »

JLeith wrote:if I removed them the Selection for 2 & 8 won't work.
No I'm not suggesting to remove them.
The order needs swapping.
So it's
Wait first then GetAscii after!
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: How to stop and collect a Keypad Digit

Post by JLeith »

I missed that step.

Off to correct.

Martin do you recall back in the day how to collect 2 digits from the keypad.

I recall a loop to get the 1st digit and then a loop to get the 2nd digit and then a formula to combine the two values.

Like Digit 1 = 2
Like Digit 2 - 4
The Sum of the Digit is 24

John

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: How to stop and collect a Keypad Digit

Post by medelec35 »

Hi John,
Yes I remember.
It's something like

Code: Select all

Result = Result * 10 + keypadnumber
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: How to stop and collect a Keypad Digit

Post by JLeith »

Excellent Help Martin

Was able to get the Master back from 2016 version to 2018.

All the best
John

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: How to stop and collect a Keypad Digit

Post by JLeith »

The "Collection of Digits is working out perfect.
Project Completed.jpg
Project Completed.jpg (31.02 KiB) Viewed 4678 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: How to stop and collect a Keypad Digit

Post by medelec35 »

Hi John, glad you are all sorted now.
This may or may not be of interest to you?
Martin

Post Reply