Keypad and collecting digits
Moderator: Benj
- 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
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] [/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
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] [/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
-
- 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
Hi John,
If you post a flowchart configured for your target device with your keypad on it, I will modify it for you.
Martin
If you post a flowchart configured for your target device with your keypad on it, I will modify it for you.
Martin
Martin
- 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
Thank you Martin
You will see the "Keypad" macro a test Digit Zero
[img] [/img]
You will see the "Keypad" macro a test Digit Zero
[img] [/img]
- Attachments
-
- Pitcher Master PIC 28 Aug 23.fcfx
- (177.16 KiB) Downloaded 224 times
-
- 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
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
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
- 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
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
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
-
- 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
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
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 226 times
Martin
-
- 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
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
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 228 times
Martin
- 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
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] [/img]
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] [/img]
-
- 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
Hi John thanks.
Can you follow how it works?
Not sure about the error pop up as there is no actual error!
Martin
Can you follow how it works?
Not sure about the error pop up as there is no actual error!
Martin
Martin
- 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
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
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
-
- Posts: 315
- Joined: Sun Jun 23, 2013 1:29 pm
- Has thanked: 28 times
- Been thanked: 61 times
- Contact:
Re: Keypad and collecting digits
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
I'm intrigued with your project - I'm working away and don't have the PC with me, could you post some PICs.
Thanks