Arduino Universal Inputs
A collection of libraries for managing/processing input devices on Arduino.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator
IInputDevice.h
Go to the documentation of this file.
1 
3 #ifndef _ARDUINOUNIVERSALINPUTS_IINPUTDEVICE_H
4 #define _ARDUINOUNIVERSALINPUTS_IINPUTDEVICE_H
5 
6 #include "UniversalInputTypes.h"
7 
15 {
16 public:
22  : m_id(id)
23  {
24  }
25 
26  virtual ~IInputDevice() {}
27 
32  inputid_t getID() const { return m_id; }
33 
38  virtual inputtype_t type() const = 0;
39 
44  virtual bool poll() = 0;
45 
46 private:
47  inputid_t m_id;
48 };
49 
50 #endif
inputid_t getID() const
Retrieves the ID of this device.
Definition: IInputDevice.h:32
virtual bool poll()=0
Polls this input device for change.
Represents an input device.
Definition: IInputDevice.h:14
uint16_t inputid_t
Holds the value of a device ID.
Definition: UniversalInputTypes.h:13
IInputDevice(inputid_t id)
Creates a new input device.
Definition: IInputDevice.h:21
inputtype_t
Enumeration of all input device types.
Definition: UniversalInputTypes.h:37
virtual inputtype_t type() const =0
Retrieves the type of this device.