16F877 and 4094 please help


Results 1 to 19 of 19

Threaded View

  1. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    This will leave your last action ON.

    Code:
    INCLUDE "modedefs.bas"
    DEFINE SHIFT_PAUSEUS 100
    
    
            
            TRISB = %00000111 
            
            alarm var BYTE
            Flag   var BYTE
    '****************************************************************
            symbol clock=portc.4
            symbol data_pin=portc.2
            symbol strb=PORTc.3
    '****************************************************************
            alarm=0
            Flag = 0
    
    start:
    Pause 10
    
           IF PORTB.0=0 THEN
           alarm=%10000000
    	Flag=1   
    ENDIF
    	   IF PORTB.1=0 THEN
           alarm=%01000000
    	Flag = 1   
    ENDIF
    	   IF PORTB.2=0 THEN
           alarm=%00100000
    	Flag = 1   
    ENDIF
     
    If Flag = 1 Then  gosub print
           goto start      
    
    print:
            
            ShiftOut data_pin,clock,0,[alarm]                              
            strb = 1  : PAUSEUS 100 :  STRB = 0
            Flag = 0
    return
    
    end
    Al.
    Last edited by aratti; - 18th October 2009 at 08:14.
    All progress began with an idea

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