16F877 and 4094 please help


Results 1 to 19 of 19

Threaded View

  1. #3
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    969


    Did you find this post helpful? Yes | No

    Default

    Code:
    INCLUDE "modedefs.bas"
    DEFINE SHIFT_PAUSEUS 100
    
    
            
            TRISB = %00000111 
            
            alarm var byte
    '****************************************************************
            symbol clock=portc.4
            symbol data_pin=portc.2
            symbol strb=PORTc.3
    '****************************************************************
            alarm=0
           
    start:
    
           IF PORTB.0=0 THEN
    	    alarm = alarm + $80      ' add the bit
           ELSE
                alarm = alarm & $7F      ' remove the bit
           ENDIF
    
           IF PORTB.1=0 THEN
    	    alarm=alarm + $40
           ELSE
                alarm = alarm & $BF      ' remove the bit
           ENDIF
    
           IF PORTB.2=0 THEN
                alarm=alarm+$20
           ELSE
                alarm = alarm & $DF      ' remove the bit
           ENDIF
           gosub print
           goto start      
    
    print:
            
            ShiftOut data_pin,clock,0,[alarm]                              
            strb = 1  : PAUSEUS 100 :  STRB = 0
            return
    
    end
    Last edited by Jerson; - 17th October 2009 at 14:09.

Similar Threads

  1. 4094 Please Help
    By dovegroup in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 10th September 2009, 12:11

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