4 keys entered on keypad flow routine

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
kilopondio
Posts: 11
Joined: Tue Feb 13, 2007 10:06 pm
Contact:

4 keys entered on keypad flow routine

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4 keys entered on keypad flow routine

Post by Benj »

Hello

Look in the Flowcode V3/Examples folder. There should be an example there that will do what you are looking for.

kilopondio
Posts: 11
Joined: Tue Feb 13, 2007 10:06 pm
Contact:

Re: 4 keys entered on keypad flow routine

Post 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!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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.
Attachments
Keypad Password.fcf
(15 KiB) Downloaded 471 times

kilopondio
Posts: 11
Joined: Tue Feb 13, 2007 10:06 pm
Contact:

Re: 4 keys entered on keypad flow routine

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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.

stubbornbull
Posts: 6
Joined: Wed Jul 22, 2009 3:52 am
Contact:

Re: 4 keys entered on keypad flow routine

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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
Attachments
Keypad Password.fcf
(15 KiB) Downloaded 350 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 4 keys entered on keypad flow routine

Post by medelec35 »

Thanks Ben.
Martin

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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
Martin

stubbornbull
Posts: 6
Joined: Wed Jul 22, 2009 3:52 am
Contact:

Re: 4 keys entered on keypad flow routine

Post by stubbornbull »

Benj wrote:Hello

Yes there is a way around this. Simply download the latest version from here.

http://www.matrixmultimedia.com/support ... .php?t=541
thanks alot BENJ, gonna give her a go right now, and sorry to everyone for threadjack

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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.

Code: Select all

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
Attachments
Keypad Password.fcf
(15 KiB) Downloaded 239 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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.

Code: Select all

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
Im not saying is complicated, but isn’t it more confusing than the original way in which strings are handled with V3?
Martin

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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 :roll: (don't answer that one :P ) 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.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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.

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 4 keys entered on keypad flow routine

Post by Steve »

It has now been fixed in v4.1 - you can now "concatenate" strings, byte variables and byte array variables together.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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?
Martin

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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).

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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 :P
Martin

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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 :P
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?
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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. :mrgreen:
Attachments
Keypad_Password_V3.fcf
(9 KiB) Downloaded 262 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 4 keys entered on keypad flow routine

Post by medelec35 »

Great! Thanks Ben.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 4 keys entered on keypad flow routine

Post 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.
Attachments
Keypad_Alarm_V3.fcf
(15 KiB) Downloaded 276 times

Post Reply