I discover some errors in the code I posted yesterday.
Code:btn1: 'actionare buton up if but1=1 and rel2=0 then 'this lines added ---------------- Gosub StartTimer ' Start the Elapsed Timer IF SecondsChanged THEN SecondsChanged = 0 IF Seconds = 10 THEN TimpulUP=1 ENDIF ENDIF '---------------------------------- high rel1 TMR1ON = 1 pause 20 '----------------------- // --------------------------------------- '----------------------- // --------------------------------------- btn2: ' actionare buton down if but2=1 and rel1=0 then 'this lines added ---------------- Gosub StartTimer ' Start the Elapsed Timer IF SecondsChanged THEN SecondsChanged = 0 IF Seconds = 10 THEN TimpulUP=1 ENDIF ENDIF '---------------------------------- high rel2 TMR1ON = 1 pause 20 '----------------------- // --------------------------------------- '----------------------- // --------------------------------------- check: ' verificare pentru supracurent adcin 3, adval vt=adval * 5000 vt=div32 1023 for cnt = 1 to 5 if vt > 270 or timpulUP=1 then u=u+1 if u > 5 or timpulUP = 1 then gpio.0=0 gpio.5=0 Gosub ResetTime endif pause 50 goto check else u=0 Gosub ResetTime endif next cnt '----------------------- // --------------------------------------- '----------------------- // ---------------------------------------
Still not work fine...




Bookmarks