Keypad and collecting digits

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:

Keypad and collecting digits

Post by JLeith »

Hello All.
Did some digging but can't get a comparason of what I'm looking for.

I have a working project and I was trying to make it ever better by getting a user to send a value via NRF905

I suspect I need a method to caputer the key entries on a 1 key at a time.
I looked at the "Lock" project but it used a Password and in my case the value will be always different

Here is a Picure of my thoughts.
[img]
Keypad to results smal.jpg
Keypad to results smal.jpg (16.02 KiB) Viewed 6974 times
[/img]

I can capture the Digit 0 just don't know how to stay in the code and collect the Digits say 1---2---5 then store then send on NFR905
The Digit 1 or 3 tells me which team and the 25 tells me what value to be sent to the team.

Can't find a way to stay in the Key 0 code and continue to collect the digits. Store them.

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: Keypad and collecting digits

Post by medelec35 »

Hi John,
If you post a flowchart configured for your target device with your keypad on it, I will modify it for you.

Martin
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: Keypad and collecting digits

Post by JLeith »

Thank you Martin

You will see the "Keypad" macro a test Digit Zero

[img]
Digit Zero small.jpg
Digit Zero small.jpg (29.08 KiB) Viewed 6965 times
[/img]
Attachments
Pitcher Master PIC 28 Aug 23.fcfx
(177.16 KiB) Downloaded 217 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: Keypad and collecting digits

Post by medelec35 »

Hi John,
Looking at this for you today.
Do you want to be able to detect 0 within Main macro to call Keypad Call macro, or will the routine have to be within Keypad Call macro before detecting the 0?


Martin
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: Keypad and collecting digits

Post by JLeith »

Hello Martin
The digits can be collected when the digit 0 is selected.
If possible in the Keypad macro. Or branch off of the Keypad 0 to a collection macro.

Thank you
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: Keypad and collecting digits

Post by medelec35 »

Hi John sorry for the delay.
I have modified flowchart so three separate numbers that are pressed on the keypad are stored in a 3 element array called Correct2.
Then the array can be used for sending the 3 separate numbers via SPI.
The routine I added can be expanded to say press * to change number if a mistake was made.

The three individual numbers can be used for menus using switch component or for other functions

Martin
Attachments
Pitcher Master PIC Sep 5.fcfx
(177.15 KiB) Downloaded 221 times
Martin

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: Keypad and collecting digits

Post by medelec35 »

Hi John,
Attached flowchart maybe just what your after?

Examples:
Press 0 then 105 will change Home to 5
or
Press 0 then 325 will change Visitor to 25

If a wrong first number is entered by mistake e.g 202 instead of 302, then it will allow you to enter the 3 digits again!

Martin
Attachments
Pitcher Master PIC Sep 6.fcfx
(178.3 KiB) Downloaded 224 times
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: Keypad and collecting digits

Post by JLeith »

Outstanding work Martin

Thank you

Martin do you happen to know why this Error Results pops up when I press the "5" to start the game

Off to load the PIC. The parents will love the work you made possible.

[img]
5 Error.jpg
5 Error.jpg (68.5 KiB) Viewed 6851 times
[/img]

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: Keypad and collecting digits

Post by medelec35 »

Hi John thanks.
Can you follow how it works?

Not sure about the error pop up as there is no actual error!

Martin
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: Keypad and collecting digits

Post by JLeith »

Hello Martin
I belive I can follow the flow.
The one Item I was not sure of (Correct= Correct MOD/100 )
Using the Print LCD for the Values of Correct and Keypress I could see the MOD combines digits 2 + 3 to a single number.

Thank you

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times
Contact:

Re: Keypad and collecting digits

Post by Docara »

Hi John,

I'm intrigued with your project - I'm working away and don't have the PC with me, could you post some PICs.
Thanks

Post Reply