How to input digits with Flowcode

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Memo
Posts: 2
Joined: Sat Dec 06, 2008 3:13 am
Contact:

How to input digits with Flowcode

Post by Memo »

Hello
I need to input 3 digits (ie:360) into a varaible to elaborate with it later on, during the program. I tried several times and in different forms with Flowcode with no results at all. I tried with switches and no luck, then I tried with keypad and nothing happen. As you may notice I'm a new Flowcode user!
Can some one help me on this and tell me how to do it?
Thanks
Memo

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: How to input digits with Flowcode

Post by Sean »

To enter a multi-digit number from a keypad you will need to build up the result one digit at a time - probably using a program loop structure.

The attached program is a simple example of a 3 digit entry system using the keypad component for data entry, and the LCD component for display.

The '#' key can be used as an 'Enter' key to terminate the loop early if fewer than 3 digits are required ('3', '5', '#' = 35).
keypad2digits.fcf
(6 KiB) Downloaded 779 times
Note: The result of a keypad read is 255 if no keys are being pressed. This is checked after each keypress is detected to prevent rapid autorepeat.

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: How to input digits with Flowcode

Post by Benj »

Hello

There are some examples packaged along with Flowcode V3 that should help you. Particularily the following.

TUT_31.FCF - XTAL - String input via switches and LCD.
TUT_32.FCF - XTAL - Password input with allow or deny.

These tutorial files can be found in the Program Files/Matrix Multimedia/Flowcode V3/Examples folder.

Memo
Posts: 2
Joined: Sat Dec 06, 2008 3:13 am
Contact:

Re: How to input digits with Flowcode

Post by Memo »

Benj
Thanks for your fast response
I tried your suggestions and worked out wonderfull.
As a matter of fact I did not know about the examples file which is a must for beginners like me.
Memo

BLOKERV3
Posts: 2
Joined: Sat Feb 07, 2009 12:14 am
Contact:

Re: How to input digits with Flowcode

Post by BLOKERV3 »

How to use one keypad to insert me the password to light a LED?

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: How to input digits with Flowcode

Post by Benj »

Hello

You should be able to tailor the above example for use with a keypad. Use the Flowcode simulation to test your program as you modify it. If you get stuck then post your program and ask how you could improve it.

Post Reply