I’m running into compilation errors when trying to use Adafruit’s MCP23X17 (or MCP23017) Arduino library on the CubeCell AB02. The core defines a pinMode(pin, mode)
macro which breaks Adafruit’s pinMode(uint8_t, uint8_t)
member function declarations, leading to syntax errors like:
error: variable or field 'PINMODE_uint8_t' declared void #define pinMode(pin,mode) PINMODE_##mode(pin)
I’ve tried placing #undef pinMode
or using #pragma push_macro/pop_macro
around includes in my sketch, but that only affects my code—library headers still compile with the macro active, so errors persist. Editing core headers feels fragile and hard to maintain.
Before resorting to writing a custom I2C helper to access MCP23017 registers directly, I wanted to ask:
- Has anyone found a cleaner way to integrate Adafruit’s expander library with CubeCell?
- Are there recommended patterns or wrapper libraries that avoid this macro conflict?
- Any configuration flags or build tricks in Arduino/CubeCell to disable or isolate the core’s
pinMode
macro for specific library includes?
I’m open to suggestions for more effective or simpler approaches than forking or reimplementing the whole library. Thanks!