Stuck with Keypad e-block exercises

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

Moderator: Benj

Post Reply
Late347
Posts: 7
Joined: Fri Nov 18, 2016 9:11 pm
Has thanked: 3 times
Contact:

Stuck with Keypad e-block exercises

Post by Late347 »

Hello, I was trying to do the matrix e-block labs exercises regarding keypad usage (labs 9, keypad, exercise B3)
I'm using pic16f1937 and e-blocks, and flowcode7 software

I tried asking my programming teacher for help, but he was reluctant to help me with any tips, either because he didn't know how to do the exercise or he just did not want to help me.

I'm completely at a loss as to what I am required to do, in order to form multi-digit integer using keypad press inputs.
I'm completely stuck about how to save the different keypressses of the keypad into different variables... At the moment I think my only skill with the keypad was to get the keypad to print into the LCD, the currently pressed key. When no key is pressed, then the LCD prints nothing. I did manage to do the exercise B1. I can give that file B1 exercise, but I'm not sure it's going to help me much...

It looks I need to record each keypress, and save it into memory so that I can form a multi-digit integer. Then I compare that multidigit integer into some kind of function (the function itself measures the character length of the multi-digit integer) . When enough characters are being seen by the program, then the program prints a warning that LCD space is close to being exceeded.

I tried to google for help but I did not find anything relevant help with flowcode7 program... (most things which I found were older versions, and I cannot open any old flowcode files using the modern flowcode7 version)


https://www.matrixtsl.com/courses/itm/i ... =Labs.Lab9

description of the exercise:
Display the numbers that are pressed on the Keypad, on the LCD, one after the other. Use the character * for a space and when # is pressed, the LCD should be cleared. Limit the maximum number of characters on the LCD to 15. Display a warning text on line 2 of the LCD when this number gets exceeded. Download this program to the PIC and test it.
Attachments
labs 9 keypad 1st exercise.fcfx
(6.97 KiB) Downloaded 216 times

medelec35
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: Stuck with Keypad e-block exercises

Post by medelec35 »

Hi Late347,
As it's a school project I won't be able to help too much.
Late347 wrote:I cannot open any old flowcode files using the modern flowcode7 version
You can open old flowcharts.
select FILE, Open....
Then select Flowcode project files (*.fcfx) drop-down list and change to Flowcode for PIC files (*.fcf) for example.
Then you can open the older type of flowchart.
I have also moved your post from Programming Tips & Tricks section.

Martin
Martin

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: Stuck with Keypad e-block exercises

Post by johnsondav »

Hi Late347

I would suggest that the 'Key Word' here for your key pad exercise is - 'handling Interrupts'. However, your selected PIC has only 1 interrupt pin 'B0'. So what can be learned from this.
First, have you had a look at the key pad design. You will find it here:

http://www.matrixtsl.com/resources/file ... 4-30-1.pdf

Can you imagine how to get the PIC to check your key pad for a key press. No Macro available so - what about which port bit is connected to what on the key pad? (columns)! see key pad eBlock data sheet

Next - How are you going to know which key in that column has been pressed (rows)

Then - how many times you has a key pad been pressed? - (count)!

Take your time and read through the key pad design PDF

The Macro's make life easy from a programing point of view but are not really necessary as it can limit the functionality greatly of any programmers hardware design based on choice of PIC/controller used.

This exercise is to get you to 'Think Outside of the Box'.

I agree with medelec35, giving you the answer would not be really helping you!

Regards
Dave

Post Reply