Arduino Universal Inputs
A collection of libraries for managing/processing input devices on Arduino.
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
ArduinoButton.h
Go to the documentation of this file.
1
3
#ifndef _ARDUINOUNIVERSALINPUTS_ARDUINOBUTTON_H
4
#define _ARDUINOUNIVERSALINPUTS_ARDUINOBUTTON_H
5
6
#include "
IButton.h
"
7
12
class
ArduinoButton
:
public
IButton
13
{
14
public
:
15
ArduinoButton
(
inputid_t
id
,
inputpin_t
pin,
bool
activeLow =
true
,
16
bool
pullUp =
true
);
17
18
virtual
~
ArduinoButton
() {}
19
24
inputpin_t
getPin
()
const
{
return
m_pin; }
25
30
bool
isActiveLow
()
const
{
return
m_activeLow; }
31
36
bool
isPullUp
()
const
{
return
m_pullUp; }
37
38
protected
:
39
uint8_t
getPhysicalState
()
const
;
40
41
private
:
42
inputpin_t
m_pin;
43
bool
m_activeLow;
44
bool
m_pullUp;
45
};
46
47
#endif
inputid_t
uint16_t inputid_t
Holds the value of a device ID.
Definition:
UniversalInputTypes.h:13
ArduinoButton::isPullUp
bool isPullUp() const
Determines if the pin is pulled high.
Definition:
ArduinoButton.h:36
inputpin_t
uint8_t inputpin_t
Holds the value of a pin number.
Definition:
UniversalInputTypes.h:19
ArduinoButton::getPhysicalState
uint8_t getPhysicalState() const
Gets the current physical state of the button.
Definition:
ArduinoButton.cpp:28
IButton
Represents a two state button.
Definition:
IButton.h:14
ArduinoButton
Represents a button on an Arduino pin.
Definition:
ArduinoButton.h:12
ArduinoButton::ArduinoButton
ArduinoButton(inputid_t id, inputpin_t pin, bool activeLow=true, bool pullUp=true)
Creates a new button on an Arduino pin.
Definition:
ArduinoButton.cpp:12
IButton.h
ArduinoButton::isActiveLow
bool isActiveLow() const
Determines if the pin logic is active low.
Definition:
ArduinoButton.h:30
ArduinoButton::getPin
inputpin_t getPin() const
Gets the pin the button is attached to.
Definition:
ArduinoButton.h:24
Generated on Fri Aug 3 2018 14:58:25 for Arduino Universal Inputs by
1.8.6