critix Posted October 24, 2011 Share Posted October 24, 2011 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 Share on other sites More sharing options...
francezu Posted October 24, 2011 Share Posted October 24, 2011 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 Share on other sites More sharing options...
critix Posted October 24, 2011 Author Share Posted October 24, 2011 Multumesc pt raspuns...Il integrez acum in restul programului.... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.