Button pressed time control
Hi all ;
First of all this is my first message for this board. I will really wonder if i'll find an answer for my problem.
My problem is that ;
I want to control a one input of pic , with a limited time pressed .
Means,
if i pressed one input ; 1 output will be high , while button pressed , pic will count pressed time for preset time over. (for example 5 sn ) .
After time over , the output will be low .
If button still pressed over 5sn , the output will not be changed . (left low)
i couldn't make an idea about how i can do that . is there a code like that ?
Please help
Help Timer Of 40 Days 12f675 Or 16f628
Hellow Melanie
I am making with 12F675 a timer that ignites PORTB.0 when pressing a pulser in RB.1 and off it to the 40 days but not like doing it, you you can help me please.
************************************************* ***************
'* Name : TIMER 40 DAYS.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2005 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 13/08/05 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
' Turn LED on. Interrupt on PORTB.0 (INTE) turns LED off.
PUSH VAR PORTB.0
LED var PORTB.1
Minutes VAR Word
Hours VAR Word
Days VAR Word
loop:
HIGH LED
GOTO LOOP
OPTION_REG = $7f
Wait40Days:
For Days = 1 to 40
For Hours = 1 to 24
For Minutes = 1 to 60
PAUSE 60000 ; 60 Seconds
Next Minutes
Next Hours
Next Days
Thank you very much
Leonard
Quote:
Originally Posted by Melanie
'means like' you need to see what that code example is doing, understand it, remove the bits you don't want and amend the timeout period for your needs.