Libraries
\ Button
Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.
Name |
Button |
Examples |
#include <Button.h>
Button button = Button(12, BUTTON_PULLUP_INTERNAL);
void setup()
{
pinMode(WLED, OUTPUT);
}
void loop()
{
if (button.isPressed())
{
digitalWrite(WLED, HIGH);
}
else
{
digitalWrite(WLED, LOW);
}
}
|
Description |
Set the initial state of this button. |
Syntax |
Button(buttonPin, buttonMode)
|
Methods |
|
Parameters |
buttonPin |
Set the pin that this switch is connected to |
buttonMode |
Indicates BUTTON_PULLUP, BUTTON_PULLUP_INTERNAL or BUTTON_PULLDOWN resistor |
|
Returns |
None |
Usage |
Application |
Updated on July 07, 2011 11:09:37pm PDT