1. A method of using an electronic device, the device comprising a current measurement unit configured to generate a measurement value indicative of a current, wherein the measurement value is based partly on a temperature, the method comprising: applying a first current to the device; setting the temperature to each of multiple temperature values; storing a first plurality of measurement values indicative of the first current for the multiple temperature values; generating a first relationship, the first relationship being between the first measurement values and the temperature; generating one or more parameters for a compensation function based on the first relationship, wherein the compensation function is dependent on temperature, and wherein the compensation function is configured to be used to determine a compensated current value based on a test current which is measured at a measurement temperature and which is received by the current measurement unit; and storing the generated parameters.