There are other advices ?! Please !
There are other advices ?! Please !
I think it's a problem with the title of my topic ... since me I am not intelligent enough to solve this !
I try another way :
Without results ! Variable "nr" seems to NOT increase ...I push "maneta", then go to memo, I push again, then go to wipper, I push again, then go to wipper again ?!?Code:@ Device PIC12F675,INTRC_OSC_NOCLKOUT, WDT_OFF,PWRT_ON,PROTECT_OFF,MCLR_OFF,BOD_OFF 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 word ' number of seconds while LED=off nr var word nr = 0 Main: IF maneta = 1 then nr = nr + 1 if nr= 1 then gosub memo else gosub wipper endif ENDIF Goto Main memo: while maneta = 1 low led wipp_time = wipp_time + 1 ' counting in 100 ms steps pause 100 wend nr = 1 return Wipper: while maneta = 1 high led pause 1000 low led pause wipp_time * 100 wend nr = 0 wipp_time = 0 Return
Sorry Fratello, but your thread title excludes me from this discussion.
I wish I could help you but this is over my head. I have enough problem keeping concentrated on my own little project.
Robert
Thanks anyway for attention !
How I say :
Re: Problems with my "intelligent timer"
I think it's a problem with the title of my topic ... since me I am not intelligent enough to solve this !
...to note the use of quotes in first row...
This is my working (in Proteus) code, i will try it tomorrow :
Best regards !Code:MAIN: led1=0 led2=0 pause 50 if but1=1 then cnt = cnt+ 1 if cnt = 1 then while but1=1 gosub memo wend endif if cnt = 2 then while but1=1 gosub check wend endif if cnt > 2 then cnt=0 endif Goto MAIN '================================================== check: high led2 pause 500 low led2 for num = 0 to 500 pause wipper call breking ' this is the new part added !!! next num return breking: if but1 = 0 then wipper = 0 goto main endif return memo: high led1 wipper = wipper + 1 ' counting in 500 ms steps pause 500 low led1 pause 500 RETURN
Bookmarks