Button pressed time control


Results 1 to 13 of 13

Threaded View

  1. #13
    tanero's Avatar
    tanero Guest


    Did you find this post helpful? Yes | No

    Default

    My code is that ;


    '----------------------------------
    @ DEVICE pic16F648A 'Device 16F648A
    @ DEVICE pic16F648A, WDT_OFF 'Watch Dog
    @ DEVICE pic16F648A, PWRT_ON 'Power on Timer
    @ DEVICE pic16F648A, PROTECT_OFF 'Cod Protect Off
    @ DEVICE pic16F648A, MCLR_OFF 'MCLR pin is not used
    @ DEVICE pic16F648A, INTRC_OSC_NOCLKOUT 'Internal osilator used
    DEFINE OSC 4 ' Osilator frekans
    CMCON=7

    TRISA=255
    TRISB=0

    PORTB=0

    BUTTONINPUT VAR PORTA.0
    LED VAR PORTB.0
    KILLER VAR PORTB.1

    Counter VAR BYTE
    Counter=0


    Loop:
    While BUTTONINPUT=0
    High LED
    Counter=Counter+1
    IF Counter=50 Then High KILLER
    Pause 100
    Wend
    Low LED
    Low KILLER
    Counter=0
    GoTo Loop

    End
    Attached Images Attached Images  

Similar Threads

  1. 8x8 keypad matrix...
    By mbox in forum General
    Replies: 5
    Last Post: - 9th October 2014, 18:43
  2. using a pot to control a time range
    By glkosec in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th June 2008, 19:59
  3. Control unlimited servos at the same time
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th September 2006, 14:14
  4. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  5. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43

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