PDA

View Full Version : Keypad/Membrane Switch



damien
- 12th October 2009, 13:39
Any assistance appreciated as I keep running round this so fast I’m in danger of disappearing up my own backside. I am trying to use a keypad or more probably a membrane switch, as I need to overlay them with pictures for kids to use. Rather than send letters or numbers to the LCD I need it to count the number of times a particular key has been pressed and display that number on the LCD.

Hardware:-

PIC ???
20x4 LCD
Keypad/Membrane Switch or even a switch matrix

Software:-

At switch-on or RESET the LCD should display a set of CONST str

WORD1 WORD2
WORD3 WORD4
WORD5 WORD6
WORD7 WORD8

It should then scan the buttons and count the number of times each button (1 – 8) is pressed and hold these numbers in a set of variables

On pressing the DISPLAY button the LCD should then show the corresponding number associated with each CONST word (or pictures as far as the child is concerned) if a button hasn’t been pressed then the number 0 should be displayed


WORD1 0 WORD2 45
WORD3 12 WORD4 22
WORD5 6 WORD6 0
WORD7 1 WORD8 14

Grateful for any help

Acetronics2
- 12th October 2009, 14:29
Hi,

What kind of assistance do you look for ???

- Hardware definition
- Scheme
- Programming point to be explained to you
- Program writing
- Pic Programming

- FULL PROJECT READY TO SWITCH ON ???

I do not understand at all what you're waiting for us to do ....

Alain

damien
- 13th October 2009, 10:02
Sorry Acetronics, it made perfect sense to me when I wrote it :( Now that I have re-read it I can see that it doesn't make any sense at all.

What I'm strugling with is the keypad/membrane switch, though I can find lots of examples of interfacing a numeric keypad. If I was using a 3x4 KP/MS I could name the buttons and variables

btn0.......btn7, btnre-set, btndisplay

var num0.......num7

The part I'm having difficulty with is the coding to scan the buttons and add a count to the appropriate var i.e.

WHILE btndiaplay = NO

SCAN btns

IF any btn is pressed and 1 to that btn's var

I hope this makes more sense and appreciate anyone offering help


P.s. a 'FULL PROJECT READY TO SWITCH ON' would be nice, if anyone has one :)