What drwheetos said is true. And, if you need even more inputs or outputs in the future, you can use an I2C GPIO Expander, [SparkFun sells one] (https://www.sparkfun.com/products/13601) that adds 16 additional input or output pins only using the I2C interface (D0/D1) on the Photon.
I want to use 2 pieces of MCP23008 (addresses 0x20 and 0x21 and suspect that I then have to write:
MCP23008 gpio(Wire, 0); //0x20
MCP23008 gpio(Wire, 1); //0x21
correct?
And how can I then set up the two separate chips with pinMode?
void setup() {
Serial.begin(9600);
gpio.begin(0); //0x20
gpio.pinMode(0, OUTPUT);
gpio.digitalWrite(0, HIGH);
gpio.begin(1); //0x21 is this correct?
gpio.pinMode(0, OUTPUT); // and what must be here?
gpio.digitalWrite(0, HIGH); // and here?