diff --git a/IODevice.cpp b/IODevice.cpp index 0f833e8..d49eedc 100644 --- a/IODevice.cpp +++ b/IODevice.cpp @@ -261,7 +261,7 @@ bool IODevice::owns(VPIN id) { // } // Read value from virtual pin. -bool IODevice::read(VPIN vpin) { +int IODevice::read(VPIN vpin) { for (IODevice *dev = _firstDevice; dev != 0; dev = dev->_nextDevice) { if (dev->owns(vpin)) return dev->_read(vpin); @@ -302,7 +302,7 @@ bool IODevice::hasCallback(VPIN vpin) { (void)vpin; // Avoid compiler warnings return false; } -bool IODevice::read(VPIN vpin) { +int IODevice::read(VPIN vpin) { pinMode(vpin, INPUT_PULLUP); return !digitalRead(vpin); // Return inverted state (5v=0, 0v=1) } diff --git a/IODevice.h b/IODevice.h index eda76ab..ca16285 100644 --- a/IODevice.h +++ b/IODevice.h @@ -102,7 +102,7 @@ public: static bool hasCallback(VPIN vpin); // read invokes the IODevice instance's _read method. - static bool read(VPIN vpin); + static int read(VPIN vpin); // loop invokes the IODevice instance's _loop method. static void loop(); @@ -348,4 +348,4 @@ private: // #include "IO_MCP23017.h" // #include "IO_PCF8574.h" -#endif // iodevice_h +#endif // iodevice_h \ No newline at end of file