Combinaton Gate access


Results 1 to 40 of 48

Threaded View

  1. #11


    Did you find this post helpful? Yes | No

    Default

    Hello mister_e,
    I magnify code it works very well but I have not been able to configure my keyboard correctly. Can help me?.
    For the access I should oppress 1,2,3, A,6 and they don't correspond this way the keys.


    I include the files in proteus.

    Thank you


    [QUOTE=mister_e;32450]tons of different way to do it. You could even set your secret code in an array, read the keypad x times, compare the result with the array.

    i'll try something.. maybe this will put some lights...
    Code:
            '                      
            '       Hardware assignment
            '       ====================
                    '
                    '   System LCD
                    '   -----------
            DEFINE LCD_DREG PORTD     ' LCD data port 
            DEFINE LCD_DBIT 4         ' LCD data starting bit 0 or 4 
            DEFINE LCD_RSREG PORTD    ' LCD register select port 
            DEFINE LCD_RSBIT 2        ' LCD register select bit 
            DEFINE LCD_EREG PORTD     ' LCD enable port 
            DEFINE LCD_EBIT 3         ' LCD enable bit 
            DEFINE LCD_BITS 4         ' LCD bus size 4 or 8 
            DEFINE LCD_LINES 2        ' Number lines on LCD 
            DEFINE LCD_COMMANDUS 2000 ' Command delay time in us 
            DEFINE LCD_DATAUS 50      ' Data delay time in us     
    
                    '
                    '   4X4 matrix Keypad
                    '   -----------------
            include "c:\PBP_PROG\Include_Routines\keypad.bas"
            DEFINE KEYPAD_ROW        4        ' 4 ROW keypad       
            DEFINE KEYPAD_ROW_PORT   PORTB    ' ROW port = PORTB
            DEFINE KEYPAD_ROW_BIT    4        ' ROW0 = PORTB.4
            DEFINE KEYPAD_COL        4        ' 4 COL keypad
            DEFINE KEYPAD_COL_PORT   PORTB    ' COL port = PORTB
            DEFINE KEYPAD_COL_BIT    0        ' COL0 = PORTB.0
            DEFINE KEYPAD_DEBOUNCEMS 100      ' debounce delay = 100 mSec
        
            '   
            '       Variables definition 
            '       ===================
            SecretCode          var byte[5]
            CounterA            var byte
            Match               var byte
        
            '
            '       Software/Hardware initialisation
            '       ================================
            secretcode[0]=1
            secretcode[1]=2
            secretcode[2]=3
            secretcode[3]=4
            secretcode[4]=5
            
            '
            '       Program start
            '       =============
    Start:
            match=0
            lcdout $FE,1,"Enter the code"
            for countera = 0 to 4
                @   READKEYPAD _Key
                if Key=secretcode[countera] then Match=Match+1
                lcdout $FE,($C0+COUNTERA),"*"
                next
    
            if match=5 then
                lcdout $FE,1,"Access Granted!"
                else
                    lcdout $FE,1,"Access denied..."
                endif
    
            PAUSE 2000
            goto start
    Attached Files Attached Files
    Last edited by Leonardo; - 12th February 2007 at 03:25.

Similar Threads

  1. A logic gate chip with 1 ea XOR and 2 ea AND gates?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 5th August 2009, 05:29
  2. Access to sim memu
    By sahin5002 in forum GSM
    Replies: 2
    Last Post: - 16th June 2009, 11:57
  3. truck gate
    By Melros in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 13th October 2007, 13:23
  4. 18f2550 'access is denied' USB error?
    By Giulio in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 30th December 2006, 14:29
  5. FYI - How to Access individual bytes in Word Arrays
    By Melanie in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th July 2003, 21:56

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