Jump to content
ELFORUM - Forumul electronistilor

Verificare cate apasari de buton sunt in 4 secunde

Recommended Posts



Se poate face in multe moduri, depinde de situatie.

Incearca asa:

(buton pe RB0, iesire pe RB1)

dim i as byteconst interv=4 as byte ; interval [secunde]...if Button(PORTB,0,100,0) then         ; daca a fost apasat butonul   for i=0 to interv*10               ; asteapta max 4 sec       Delay_ms(100)                  ; pentru       if (RB0_Bit=0) then            ; a doua apasare, si          RB1_Bit=1                   ; activeaza iesirea          break      end if  next i                                ; expirare perioadaend if
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines