Button Function in uC

General discussion on mikroC.
Post Reply
Author
Message
Jacquesdj
Posts: 1
Joined: 03 Jul 2005 10:19
Location: South Africa

Button Function in uC

#1 Post by Jacquesdj » 03 Jul 2005 10:28

Anyone please explain how the button fcuntion in C works ??

Many Thanks ;)

bool status
status = 1;

void main(){
do{
if (button(PortA,0,1,1) & status)
{
PortB.F0 = 1;
}
else
{
PortB.F1 = 1;
}
}while(1)
}

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

Re: Button Function in uC

#2 Post by pizon » 04 Jul 2005 09:38

Code: Select all

button(&PortA,0,2,1)
returns 0xFF (true) if pin RA0 has been set to logical 1 for 2 msecs, returns 0 otherwise.

Code: Select all

button(&PortC,6,1,0)
returns 0xFF (true) if pin RC6 has been set to logical 0 for 1 msecs, returns 0 otherwise.

Please take a look at mikroC Help for further explanations and examples.
pizon

Post Reply

Return to “mikroC General”