Jump to content
ELFORUM - Forumul electronistilor

Verificare cate apasari de buton sunt in 4 secunde


critix

Recommended Posts

Salutare.Am un interval de 4 sec in care, daca un pin este pe 0 de 2 ori (pinul este pe 0 printr-un buton), sa anclasez un releu pe alt pin.Ma puteti ajuta cu partea de cod?Folosesc MikroBasic si 16F628.Va multumesc.

Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • critix

    2

  • francezu

    1

Popular Days

Top Posters In This Topic

Salut!

 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • 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