Using the buttonPress library for the Atmel AVR microcontroller. The function is called ButtonPressed and it returns a char for testing if the push button is actually pressed. The parameters are the button number, port where the button is connected, pin of the port where the button is connected, and the confidence level threshold.
Usage:
char ButtonPressed(int buttonNumber, unsigned char pinOfButton, unsigned char portBit, int confidenceLevel)
Example:
if (ButtonPressed(0, PINB, 0, 100) { Code if the button is pressed... }
Comments and Additional Information
Have some code to share? Or additional information? Respond here:
You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.