Datasheet

Programming PIC Microcontrollers in BASIC - mikroElektronika
Prototype
sub function Button(dim byref PORT as byte, dim Pin as byte, dim Time as
byte, dim Astate as byte) as byte
Description Function eliminates the influence of contact flickering due to the pressing of a button (debouncing).
Parameters <PORT> and <Pin> specify the location of the button; parameter <Time> represents the minimum
time interval that pin must be in active state in order to return one; parameter <Astate> can be only zero or one,
and it specifies if button is active on logical zero or logical one.
Example
if Button(PORTB, 0, 1, 1) then
flag = 255
end if
PIC, PIC, PICmicro, and MPLAB are registered and protected trademarks of the Microchip Technology Inc. USA. Microchip logo and name
are the registered tokens of the Microchip Technology. mikroBasic is a registered trade mark of mikroElektronika. All other tokens mentioned
in the book are the property of the companies to which they belong.
mikroElektronika © 1998 - 2004. All rights reserved. If you have any questions, please contact our
office.
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (112 sur 112)05/11/2004 02:20:55