Thank You !
...but the schematic dont work if I wish
...
Code:
@ Device PIC12F675,INTRC_OSC_NOCLKOUT, WDT_OFF,PWRT_ON,PROTECT_OFF,MCLR_OFF,BOD_OFF
Include "C:\WIPPER\Elapsed.bas" ' just wsave(s) removed
CLEAR
DEFINE OSC 4
ANSEL=0
CMCON=7
TRISIO=%00100000
maneta var gpio.5
LED var GPIO.2 ' set GPIO.0 port as OUTPUT (LED)
wipp_time var byte ' number of seconds while LED=off
nr var bit
delay var word
nr = 0
low LED
Gosub ResetTime ' reset Time to 0d-00:00:00.00
Main:
IF GPIO.5 = 1 then
nr=nr+1
if nr=1 then
gosub memo ' set wipe_time
else
gosub wipper ' use seconds elapsed as wipe_time
nr = 0 ' ready for another setting of wipe_time
endif
if nr > 2 then nr = 0
ENDIF
Goto Main
memo:
gosub StartTimer
while maneta = 1
wipp_time = seconds ' seconds counts from the beginning of gpio.5 = 0
wend
Gosub StopTimer
Gosub ResetTime
return
Wipper:
Delay = wipp_time * 1000
While gpio.5 = 1
Pause 1000
Led = !Led
If Delay= 0 then Skip_0
Pause 1
Delay = Delay - 1
Skip_0:
Wend
Return
Bookmarks