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

User avatar
JLeith
Posts: 519
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 143 times
Been thanked: 24 times
Contact:

How to stop and collect a Keypad Digit

Postby JLeith » Thu Sep 06, 2018 3:44 am

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 40 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8334
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2382 times
Been thanked: 3393 times
Contact:

Re: How to stop and collect a Keypad Digit

Postby medelec35 » Thu Sep 06, 2018 7:31 am

Hi John,
Good to see you back on the forums as well.
I have spotted two issues within Keypad macro:
Flowchart issues.png
Flowchart issues.png (31.51 KiB) Viewed 1253 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.
These users thanked the author medelec35 for the post:
JLeith (Thu Sep 06, 2018 3:47 pm)
Rating: 5.56%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 519
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 143 times
Been thanked: 24 times
Contact:

Re: How to stop and collect a Keypad Digit

Postby JLeith » Thu Sep 06, 2018 3:48 pm

Thank you Martin

Off to make it happen and refresh my knowledge

John :D

User avatar
JLeith
Posts: 519
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 143 times
Been thanked: 24 times
Contact:

Re: How to stop and collect a Keypad Digit

Postby JLeith » Thu Sep 06, 2018 5:15 pm

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 1234 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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8334
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2382 times
Been thanked: 3393 times
Contact:

Re: How to stop and collect a Keypad Digit

Postby medelec35 » Thu Sep 06, 2018 5:46 pm

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

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 519
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 143 times
Been thanked: 24 times
Contact:

Re: How to stop and collect a Keypad Digit

Postby JLeith » Thu Sep 06, 2018 7:49 pm

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8334
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2382 times
Been thanked: 3393 times
Contact:

Re: How to stop and collect a Keypad Digit

Postby medelec35 » Fri Sep 07, 2018 2:47 pm

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

Code: Select all

Result = Result * 10 + keypadnumber
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JLeith
Posts: 519
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 143 times
Been thanked: 24 times
Contact:

Re: How to stop and collect a Keypad Digit

Postby JLeith » Sat Sep 08, 2018 4:46 pm

Excellent Help Martin

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

All the best
John

User avatar
JLeith
Posts: 519
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 143 times
Been thanked: 24 times
Contact:

Re: How to stop and collect a Keypad Digit

Postby JLeith » Sat Sep 08, 2018 4:56 pm

The "Collection of Digits is working out perfect.

Project Completed.jpg
Project Completed.jpg (31.02 KiB) Viewed 1188 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8334
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2382 times
Been thanked: 3393 times
Contact:

Re: How to stop and collect a Keypad Digit

Postby medelec35 » Sat Sep 08, 2018 5:17 pm

Hi John, glad you are all sorted now.
This may or may not be of interest to you?
These users thanked the author medelec35 for the post:
JLeith (Sat Sep 08, 2018 6:00 pm)
Rating: 5.56%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.