Button code query

General discussion on mikroC.
Post Reply
Author
Message
roro36
Posts: 9
Joined: 21 Sep 2010 08:10

Button code query

#1 Post by roro36 » 04 Nov 2010 13:35

Not quite sure what the numbers mean in this following line:

if (Button(&PORTB, 4, 1, 1))

Portb pin 4 then what do the 2 1's mean?

KaranSoin
Posts: 130
Joined: 07 May 2010 22:27
Location: Melbourne, Australia

Re: Button code query

#2 Post by KaranSoin » 05 Nov 2010 02:30

The first '1' is the debounce time in milliseconds (which seems a little low, most metallic contact buttons flickers more than that, I usu use 10-20 ms). The second '1' basically specifies weather you get a logical high when button is pressed or logical low when button is pressed.



Regards

roro36
Posts: 9
Joined: 21 Sep 2010 08:10

Re: Button code query

#3 Post by roro36 » 05 Nov 2010 08:33

Thanks, will try this out.

Post Reply

Return to “mikroC General”