Page 1 of 1

How to stop and collect a Keypad Digit

Posted: Thu Sep 06, 2018 3:44 am
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

Re: How to stop and collect a Keypad Digit

Posted: Thu Sep 06, 2018 7:31 am
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.

Re: How to stop and collect a Keypad Digit

Posted: Thu Sep 06, 2018 3:48 pm
by JLeith
Thank you Martin

Off to make it happen and refresh my knowledge

John :D

Re: How to stop and collect a Keypad Digit

Posted: Thu Sep 06, 2018 5:15 pm
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 4837 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

Re: How to stop and collect a Keypad Digit

Posted: Thu Sep 06, 2018 5:46 pm
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!

Re: How to stop and collect a Keypad Digit

Posted: Thu Sep 06, 2018 7:49 pm
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

Re: How to stop and collect a Keypad Digit

Posted: Fri Sep 07, 2018 2:47 pm
by medelec35
Hi John,
Yes I remember.
It's something like

Code: Select all

Result = Result * 10 + keypadnumber

Re: How to stop and collect a Keypad Digit

Posted: Sat Sep 08, 2018 4:46 pm
by JLeith
Excellent Help Martin

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

All the best
John

Re: How to stop and collect a Keypad Digit

Posted: Sat Sep 08, 2018 4:56 pm
by JLeith
The "Collection of Digits is working out perfect.
Project Completed.jpg
Project Completed.jpg (31.02 KiB) Viewed 4791 times

Re: How to stop and collect a Keypad Digit

Posted: Sat Sep 08, 2018 5:17 pm
by medelec35
Hi John, glad you are all sorted now.
This may or may not be of interest to you?