Sometimes there is a need for more IO than can be catered for using an single set of pins,even on the MEGA, or maybe you just want to combine Arduino pins with some pins on anPCF8574 IO expander chip.
In this case IoAbstraction now supports that, you create an abstraction of type
MultiIoAbstraction
.See the sketch that has Arduino pins and PCF8574 on the same IoAbstractionin the packaged examples.Aug 26, 2011 The sixteen I/O ports are separated into two ‘ports’ – A (on the right) and B (on the left. Pin 9 connects to 5V, 10 to GND, 11 isn’t used, 12 is the I2C bus clock line (Arduino Uno/Duemilanove analogue pin 5, Mega pin 21), and 13 is the I2C bus data line (Arduino Uno/Duemailnove analogue pin. 40-Channel I2C Digital I/O Expander. The I2C-XIO is purely an I/O expander, and doesn't integrate either an MRBus interface or microcontroller. For those interested in the same functionality, but with an onboard ATMega328 and MRBus interface, check out the MRB-XIO. For Arduino users looking to expand the number of IO lines (up to 8. 40 = 320!).
For the example, build the circuit exactly as per the standard i2c expander example,but this time this sketch also switches on and off the built in LED pin as well, showing it is possible to useboth built in pins and the expander at the same time.
Using MultiIoAbstraction
Step 1 create an instance globally, telling it how many pins to allocate to Arduino (defaults to 100):
Step 2 in the setup method register additional devices
Then use it just like you would any other IO Abstraction.
Other pages within this category
I/O Expander shield is a shield used to expand the number of I/Os of an Arduino Uno. It is based on the chipset MCP23017. The chipset MCP23017 communicates with Arduino Uno through I2C interface. It adds GPIOA and GPIOB, a total of 16 I/Os. There are two LEDs and two buttons on the shield. User can decide if they want to use the built-in LED/buttons or not by using the 4-bit DIP switch.
- 16 bidirectional I/O ports. Default is input state.
- High-speed IIC interface (MCP23017): 100kHz, 400kHz, 1.7MHz
- Three hardware address pins allow up to eight devices on the bus
- Configurable interrupt output pin: can be configured for active-high (output), active-low (output) or open-drain (output)
- INTA and INTB can be configured to work independently or jointly
- Configurable interrupt sources: the interrupt changes according to the configured register defaults or pin level changes
- External reset input
- Low standby current: 1μA (max)
- Operating voltage:
- 1.8V to 5.5V (-40 ° C to +85 ° C)
- 2.7V to 5.5V (-40 ° C to +85 ° C)
- 4.5V to 5.5V (-40 ° C to +125 ° C)
1. Install I/O Expander Shield onto Arduino UNO and power on,
2. Open Arduino IDE and copy the code, then upload to Arduino
3. Set all Jumpers to ON, press the button S1 and S2 respectively.
Press S1, L1 (RED) will turn on.
Press S2, L2 (GREEN) will turn on.
Previous tabNext tab