keypad?


Closed Thread
Results 1 to 3 of 3

Thread: keypad?

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    france
    Posts
    47

    Default keypad?

    Hello

    I have a problem with this program for managing a keypad.
    when I press a key such as 1, it displays "1111" when I
    supported once the?

    thank you
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jonas2 View Post
    Hello

    I have a problem with this program for managing a keypad.
    when I press a key such as 1, it displays "1111" when I
    supported once the?

    thank you
    Hi Jonas2,
    I see 2 things I question:
    1. IF i = 4 THEN GOTO confirm ' code complet ? oui confirme
    0 to 3 so it should be complete @ 3

    2. You are exiting a for next loop in a rude fashion. I would tell the loop row = 3 and then gosub. IMHO
    Like so
    Code:
    FOR row = 0 TO 3                     ' 4 rows in keypad
                PORTB = 0                            ' All output-pins low
                TRISB = (DCD row) ^ $ff              ' Set one row pin to output
                col = PORTB >> 4                     ' Read columns
                IF col != $f THEN row = 3              ' If any key  own, exit
                NEXT row
                Gosub gokey
                return
    It just clears the stack. AND Maybe your pause 100 is faster than your key finger too
    Last edited by Archangel; - 13th August 2009 at 22:25.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Feb 2006
    Location
    france
    Posts
    47


    Did you find this post helpful? Yes | No

    Default keypad

    Hi

    Yes, but the variable code0 has 1, 2 account code1, code2 account 3 code 3 has 4
    IF i = 0 THEN
    code0 = 1 >>>>> xkey
    endif

    IF i = 1 THEN
    code1 = xkey >>>>>> 2
    endif

    IF i = 2 THEN
    code2 = xkey
    endif

    IF i = 3 THEN
    Code3 = xkey >>>>>> 4
    endif

    PAUSE 50

    i = i + 1
    IF i = 4 THEN GOTO confirm

    So it is, I think the problem comes from the relaxation of the?

Similar Threads

  1. Matrix Keypad routine
    By mister_e in forum Code Examples
    Replies: 134
    Last Post: - 18th September 2022, 20:30
  2. 4x4 keypad Help
    By aaliyah1 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th October 2010, 16:34
  3. Keypad input test
    By Kalind in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th October 2008, 04:00
  4. Need help in matrix keypad coding
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 24th May 2008, 13:16
  5. Keypad unlock (as in garage door possibly)
    By Fred in forum Code Examples
    Replies: 5
    Last Post: - 2nd April 2006, 04:26

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts