diff --git a/IODevice.cpp b/IODevice.cpp index d49eedc..81bea0e 100644 --- a/IODevice.cpp +++ b/IODevice.cpp @@ -42,7 +42,7 @@ // and PCA9685. void IODevice::begin() { // Initialise the IO subsystem - ArduinoPins::create(2, NUM_DIGITAL_PINS-3); // Reserve pins for direct access + ArduinoPins::create(2, NUM_DIGITAL_PINS-2); // Reserve pins for direct access // Predefine two PCA9685 modules 0x40-0x41 // Allocates 32 pins 100-131 PCA9685::create(100, 16, 0x40); diff --git a/IODevice.h b/IODevice.h index ca16285..6717c8b 100644 --- a/IODevice.h +++ b/IODevice.h @@ -344,8 +344,8 @@ private: ///////////////////////////////////////////////////////////////////////////////////////////////////// -// #include "IO_MCP23008.h" -// #include "IO_MCP23017.h" -// #include "IO_PCF8574.h" +#include "IO_MCP23008.h" +#include "IO_MCP23017.h" +#include "IO_PCF8574.h" #endif // iodevice_h \ No newline at end of file diff --git a/IO_PCA9685.cpp b/IO_PCA9685.cpp index a6bde29..dd2a607 100644 --- a/IO_PCA9685.cpp +++ b/IO_PCA9685.cpp @@ -129,7 +129,7 @@ void PCA9685::_write(VPIN vpin, int value) { s->numSteps = profile==Fast ? 10 : profile==Medium ? 20 : profile==Slow ? 40 : - profile==Bounce ? sizeof(_bounceProfile) : + profile==Bounce ? sizeof(_bounceProfile)-1 : 1; s->state = value; s->stepNumber = 0; @@ -163,7 +163,7 @@ void PCA9685::_writeAnalogue(VPIN vpin, int value, int profile) { s->numSteps = profile==Fast ? 10 : profile==Medium ? 20 : profile==Slow ? 40 : - profile==Bounce ? sizeof(_bounceProfile) : + profile==Bounce ? sizeof(_bounceProfile)-1 : 1; s->stepNumber = 0; s->toPosition = min(value, 4095);