Page 1 of 1
4 keys entered on keypad flow routine
Posted: Wed Jul 01, 2009 12:10 am
by kilopondio
Hi people!,
I just need some flow code to read 4 keys on the keypad.I got to enter a code of 4 numbers to ge a password.
Thanks a lot and have a nice week!
Kilo
Re: 4 keys entered on keypad flow routine
Posted: Thu Jul 02, 2009 9:09 am
by Benj
Hello
Look in the Flowcode V3/Examples folder. There should be an example there that will do what you are looking for.
Re: 4 keys entered on keypad flow routine
Posted: Thu Jul 02, 2009 3:45 pm
by kilopondio
Thanks a lot Ben for your explanation!.
Yes it's true there is a TUT_32 where we can see some sample explaining how to enter a password by means of 4 keys but it is not a keypad.I do imagine that it can be altered to make some routine reading keypad.
Bye!
Re: 4 keys entered on keypad flow routine
Posted: Thu Jul 02, 2009 4:16 pm
by Benj
Hello
Ok I see, sorry I thought the example was using a keypad already.
As it happens I do have a keypad example which is why I was getting confused. Its too hot today.
Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 03, 2009 4:40 pm
by kilopondio
Ok Ben thanks again but I wanted to know how does your routine work?.
I just need that 4 numbers enter like a password and in case of its ok some led start to blink or some comes to open.
Greetings!.
Kilo
Re: 4 keys entered on keypad flow routine
Posted: Mon Jul 06, 2009 4:10 pm
by Benj
Hello
The numbers you enter on the keypad are stored into a string using the input string macro.
When you hit the * key the input string macro is exited and the string is compared with a string stored in memory. If the strings match up then RC1 will become high, if the strings do not match up then RC0 will become high.
The program is well commented so you should be able to get to grips with whats going on by working your way through the icons.
Re: 4 keys entered on keypad flow routine
Posted: Thu Jul 23, 2009 11:01 pm
by stubbornbull
Benj wrote:Hello
Ok I see, sorry I thought the example was using a keypad already.
As it happens I do have a keypad example which is why I was getting confused. Its too hot today.
hey BENJ
my version of flowcode(v3.1.0.31) wont open the example (keypad password.fcf), it says 'its of a newer version and may not load correctly' and it asks me if wish to continue, of course i hit yes, then it says 'flowcode could not load one of the components in the file because it is not registered on this machine. install the necessary component before opening this file.'
would you know of any way around this? mahalo's
Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 24, 2009 8:11 am
by Benj
Hello
Yes there is a way around this. Simply download the latest version from here.
http://www.matrixmultimedia.com/support ... .php?t=541
Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 24, 2009 12:25 pm
by medelec35
I just had a look at keypad password file and in Input_String macro, It has input string and end routine looking for the same * char.
So macro will never exit?
Or have I got that wrong?
When I edit macro and change switch = '*' to switch = '#' I just get undefined variable "" at positon 9 message.
Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 24, 2009 2:20 pm
by Benj
Hello
Yes you are correct this is indeed wrong. The * character should clear the string and the # should allow the string to be checked.
I have also been able to replicate the problem with using the # character in the decision icon and hopefully we will be able to solve this in V4.1
For now you could use the ASCII value for the # character so instead of
switch = '#'
you can use this
switch = 35
Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 24, 2009 4:02 pm
by medelec35
Thanks Ben.
Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 24, 2009 5:14 pm
by medelec35
There is a problem with string manipulation.
1) When key is pressed, this key is not shown on LCD display which stays blank.
2) If click on input string icon to open without altering any of the equation , just click OK. A message is displayed: 'One or more of string manipulation lines are invalid' etc so it look like string and bytes can't be mixed in V4 string i/p? Also the value of string variable is not displayed in the variable window. I am assuming you took open a V3 flowcode and saved as V4?
If so conversion has failed. At least for the flowcode simulation side. I will conduct some more tests.
Edit: Works OK with V3. String values are shown on both LCD and variables window. Just a problem with V4
Re: 4 keys entered on keypad flow routine
Posted: Sat Jul 25, 2009 5:07 am
by stubbornbull
thanks alot BENJ, gonna give her a go right now, and sorry to everyone for threadjack
Re: 4 keys entered on keypad flow routine
Posted: Mon Jul 27, 2009 9:23 am
by Benj
Hello
In V4 it was decided that allowing bytes to be added to strings was a bit confusing so you will have to do the following workaround.
1) Create another string variable 1 byte in size eg Temp_String[1]
2) Using a calculation icon assign the value of the keypress to the string variable.
3) Add the temporary string to your main password string using the original string manipulation icon.
Input_string = Input_string + Temp_String
Re: 4 keys entered on keypad flow routine
Posted: Mon Jul 27, 2009 12:19 pm
by medelec35
Thank you for work around and posting file. Appreciated as always.
Benj wrote:In V4 it was decided that allowing bytes to be added to strings was a bit confusing so you will have to do the following workaround.
To me that means two things.
1) V4 where strings are concerned is not backward compatible. I believed V4 was supposed to be fully compatible with all V3 files.
2) By doing following steps:
Benj wrote:Hello
1) Create another string variable 1 byte in size eg Temp_String[1]
2) Using a calculation icon assign the value of the keypress to the string variable.
3) Add the temporary string to your main password string using the original string manipulation icon.
Input_string = Input_string + Temp_String
Im not saying is complicated, but isn’t it more confusing than the original way in which strings are handled with V3?
Re: 4 keys entered on keypad flow routine
Posted: Mon Jul 27, 2009 4:18 pm
by medelec35
Thanks. V4 version works great! Maybe it could be used as a tutorial file, it has a useful string application. The reason for the sound off on the previous post, is: we have a very good product, with great support but if we did not have internet and was playing/learning about flowcode. How could we have known to:
1) Create another string variable 1 byte in size eg Temp_String[1]
2) Using a calculation icon assign the value of the keypress to the string variable.
Temp_String[0] = switch
3) Add the temporary string to your main password string using the original string manipulation icon.
Input_string = Input_string + Temp_String
It does not say that in the help files! or is it me being dumb

(don't answer that one

) and I should of worked that one out easily. (you can answer that!)
Sorry If I sound ungrateful. Im not.
Keep up the good work.
Re: 4 keys entered on keypad flow routine
Posted: Tue Jul 28, 2009 8:19 am
by Benj
Hello Medelec
No I think your right it would have been hard to find out why that suddenly wasnt working anymore and also about the lack of mention in the help file. I can appreciate your reasons for concern. We are trying to fix this for V4.1 so the String manipulation allows bytes to be added directly again.
Re: 4 keys entered on keypad flow routine
Posted: Tue Jul 28, 2009 8:38 am
by Steve
It has now been fixed in v4.1 - you can now "concatenate" strings, byte variables and byte array variables together.
Re: 4 keys entered on keypad flow routine
Posted: Tue Jul 28, 2009 11:22 am
by medelec35
steve wrote:It has now been fixed in v4.1 - you can now "concatenate" strings, byte variables and byte array variables together.
Thanks, that's great news.
Is there an estimated release date for V4.1 please?
Re: 4 keys entered on keypad flow routine
Posted: Tue Jul 28, 2009 11:43 am
by Steve
I am still waiting for some translations to come in, but I'm very keen to get it finished before I go on holiday (mid August).
Re: 4 keys entered on keypad flow routine
Posted: Wed Jul 29, 2009 8:48 pm
by medelec35
stubbornbull wrote:
my version of flowcode(v3.1.0.31) wont open the example (keypad password.fcf), it says 'its of a newer version and may not load correctly' and it asks me if wish to continue, of course i hit yes, then it says 'flowcode could not load one of the components in the file because it is not registered on this machine. install the necessary component before opening this file.'
would you know of any way around this? mahalo's
Same applies with V3.6.11.53
@ben
Are you sure it was created with V3 and not V4?..... after all it was hot that day

Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 31, 2009 6:24 am
by medelec35
medelec35 wrote:stubbornbull wrote:
my version of flowcode(v3.1.0.31) wont open the example (keypad password.fcf), it says 'its of a newer version and may not load correctly' and it asks me if wish to continue, of course i hit yes, then it says 'flowcode could not load one of the components in the file because it is not registered on this machine. install the necessary component before opening this file.'
would you know of any way around this? mahalo's
Same applies with V3.6.11.53
@ben
Are you sure it was created with V3 and not V4?..... after all it was hot that day

As you can guess the hot day comment was a joke, but was not joking when I said same applies with V3.6.11.53,
Is there a reason for it not to work on my V3? have I miss a update posted else where to get this file working?
Error message when load file is: The file you are loading ws made by a newer version of flowcode (31 > 20) and may not load correctly'
What does the (31>20) signify? I'm assuming a component that is V31 is opened in flowcode with V20 component in?
Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 31, 2009 9:47 am
by Benj
Hello Medelec
Your right it was too hot that day. I was sure I edited the file with V3 but after trying to open my multiple copies here I found out none of them would open with V3. So here is the file rewritten and guarenteed for V3.

Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 31, 2009 10:35 am
by medelec35
Great! Thanks Ben.
Re: 4 keys entered on keypad flow routine
Posted: Fri Jul 31, 2009 2:34 pm
by Benj
Hello
I took this example slightly further for another customer so I might as well post it here too. This simply allows you to do things once you have provided a valid password. The example lets you control an output pin (RA0, I think) once you have gotten past the password protection.