Dear All,
I want to understand following button sense program, specifically the meaning of the following part of the program-
(Button(&PORTB, 0, 1, 1)). Please consider that I am new to PIC programming. Thanks in advance.
///////////////////////////////////////////////////////////////////////////
do {
if (Button(&PORTB, 0, 1, 1)) { // Detect logical one
oldstate = 1; // Update flag
}
if (oldstate && Button(&PORTB, 0, 1, 0)) { // Detect one-to-zero transition
PORTC = ~PORTC; // Invert PORTC
oldstate = 0; // Update flag
}
} while(1);
//////////////////////////////////////////////////////////////////
Source of the code:
https://download.mikroe.com/documents/compilers/mikroc/pic/help/button_library.htm