Flowcode V4 and large Keypads

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

Post Reply
Woode
Posts: 10
Joined: Fri Dec 26, 2008 4:11 pm
Been thanked: 2 times
Contact:

Flowcode V4 and large Keypads

Post by Woode »

Version 4 allows multiple keypads so the number of pads is only limited by the number of nibles (half bytes) available.
ie. You can set up 48 keys (3 keypads) from 12 bits! :lol:

The keypads are selected to the custom setting and an image added to the panel behind the keypad.
This image is 120x120 pixels and uses 14pt Arial bold, if only single characters are used and 14pt Arial Narrow bold, if
double characters are used.

The attached file contains the flowcode example and 5 images for the key background. These can be modifed with
Paint Shop.

Do not forget, in the real world, two or more keys can be pressed at the same time causing a possible short on the outputs. Resistors must be used to prevent any shorts.
Attachments
48 Keypad.zip
(19.74 KiB) Downloaded 734 times

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: Flowcode V4 and large Keypads

Post by Sean »

Hello,

We will be improving the instructions for using the custom image options in the Keypad, LED, Switch, and ADC components. The current information is not very clear.

When the custom image option is selected in any of these components, image boxes are displayed into which the required image files can be drag-dropped. New versions of the components now contain default custom images displaying the message "Drag Image Here" before first use.

Images of almost any resolution can be used, and will be scaled to fit within the image boundary. They will also resize automatically when the the component size is changed. Large images can affect the speed of simulation.

In the case of the keypad, when the custom image option is selected, the property page displays the selected keypad layout as an array of image boxes. Each box can have a file containing the image of the required keycap dragged into it.

We will be supplying a library of standard images with future releases of Flowcode.

mauro
Posts: 8
Joined: Tue Jul 12, 2011 8:09 pm
Has thanked: 41 times
Been thanked: 1 time
Contact:

Re: Flowcode V4 and large Keypads

Post by mauro »

Hi, being a newbie i thought this was pretty neat ... i modified the flow chart to my requirements and ran the simulation. All was well :D Now to try it in the real world... I Compiled to Hex... and... i tried to change Columns with Rows, tried different ports and Pics... to no avail. :? Please help. I have included a copy of the fcd below. Thank you.

32_Keypad_1.c
Starting preprocessor: c:\PROGRA~1\MATRIX~1\FLOWCO~1\boostc\pp.exe 32_Keypad_1.c -i c:\PROGRA~1\MATRIX~1\FLOWCO~1\boostc\include -d _PIC16F877 -la -c2 -o 32_Keypad_1.pp -v -d _BOOSTC -d _PIC16 -d _CHAR_INDEX

....................

32_Keypad_1.c(220:12): error: variable 'mtxKeysAsChars' already exists
32_Keypad_1.c(221:12): error: variable 'mtxKeysAsNumbers' already exists
32_Keypad_1.c(223:12): error: variable 'mtxCols' already exists
32_Keypad_1.c(224:12): error: variable 'mtxRows' already exists
32_Keypad_1.c success

failure
..
Return code = 1

Flowcode was unable to compile the flowchart's C code due to the following errors:

If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.

FINISHED
Attachments
32_Keypad_1.fcf
(24.41 KiB) Downloaded 435 times

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: Flowcode V4 and large Keypads

Post by JohnCrow »

Hi
Not sure if this will totally cure you problem but you have the connections on the keypads wrong

1) Your need each pad on a different port i.e. B & C
2)

Column 1 2 3 4
Bit 0 1 2 3

Row A B C D
Bit 4 5 6 7

You seem to have rows & columns connected to the same bits on K0
and across 2 ports on K1

Also Im not sure if you can have 2 keypads on 1 flowchart (never tried it) Though by removing 1 of the keypads (and the macro calling it) it does compile to hex ok


Ive done a quick mod for you on the keypad lines to show how they should be configured
32_Keypad_1-mod.fcf
(24.36 KiB) Downloaded 420 times
1 in 10 people understand binary, the other one doesn't !

mauro
Posts: 8
Joined: Tue Jul 12, 2011 8:09 pm
Has thanked: 41 times
Been thanked: 1 time
Contact:

Re: Flowcode V4 and large Keypads

Post by mauro »

Hi John,
Looks like you're right... one keypad per port per flowchart, (for the real world) tried splitting the keypad... Rows on one port and Columns on another... some weird results! I thought i could get away with fewer I/O, as my Keypad Bus is limited to 16 lines and i have to multiplex a led array on those keypads aswell. What i gather from scouting the forums, it doesn't look like we will have custom keypads greater than 4x4.

What i don't get, is why in simulation, the 2x Keypad Matrix works?

Thanx for the mod.
Attachments
32_Keypad_Port C + Port A.fcf
(24.41 KiB) Downloaded 411 times
Keypad Matrix.jpg
Keypad Matrix.jpg (19.61 KiB) Viewed 6561 times

Post Reply