       }
       mask = mask << 1;
     }
+    Serial.println(F("Write digital"));
     writePort(port, (byte)value, pinWriteMask);
   }
 }

    }
    break;
  default:
    BLE_Firmata.sendString("Unknown pin mode"); // TODO: put error msgs in EEPROM
  }
  // TODO: save status to EEPROM here, if changed
}

    break;
  case INPUT:
    if (IS_PIN_DIGITAL(pin)) {
      Serial.println("input");
      pinMode(PIN_TO_DIGITAL(pin), INPUT); // disable output driver
      digitalWrite(PIN_TO_DIGITAL(pin), LOW); // disable internal pull-ups
      pinConfig[pin] = INPUT;
      
      // MEME update so we have an update report
      uint8_t tempport = pin/8;
      uint8_t temppin = reportPINs[tempport];
      reportDigitalCallback(tempport, temppin | (1<<(pin % 8)));
      //
    }
    break;
  case OUTPUT:
