I did it again !
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
LED VAR GPIO.0 ; sets the GPIO.0 port as LED
wipp_time var byte ; number of seconds while LED=off
nr var bit
nr = 0
low led
Gosub ResetTime ' Reset Time to 0d-00:00:00.00
loop:
IF GPIO.5 = 0 THEN
nr=nr+1
if nr=1 then
gosub memo ' Setting 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 loop
memo:
gosub StartTimer
while gpio.5 = 0
wipp_time = seconds ' seconds counts from the beginning of gpio.5 = 0
wend
Gosub StopTimer
Gosub ResetTime
return
wipper:
while gpio.5 = 0
LED = 1
PAUSE 1000
LED = 0
PAUSE (wipp_time * 1000)
wend
return
END ' of story !
Thanks for support !
Bookmarks