Added a function to setup the device from EEPROM