EXTREME BEGINNER QUESTION (input function)

I have a very basic question here regarding the INPUT function. I am playing with a PIC Microcontroler and trying to make it respond to buttons. In the process I learned that I need to have a debouncer for the buttons, since the pressing of a button is registered more than once on a single push.
Since I have multiple buttons, I would like to write a simple little function that will take as input the button pushed and debounce it.
Following is the code I am currently using:
void debounce(int bt)
{
delay_ms(250);
while(!input (bt))
delay_ms(20);
}
The message I get is:
Expression must evaluate to a constant.

Every example I saw sofar is not telling me how to pass a variable to a function like INPUT. They usually pass #DEFINEs i.e.
input (PIN_A1)

Is it possible to pass a variable to input?

thanx
Iggy
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories