A method for programming a function of an optical mouse during assembly, comprising:
- mounting a dummy resistor on a printed circuit board, the dummy resistor being indicative of a parameter of the function;
- mounting an optical mouse sensor and a nonvolatile memory on the printed circuit board;
- electrically coupling a laser to the optical mouse sensor to receive a drive current;
- further assembling the optical mouse;
- after said further assembling the optical mouse:
- determining the parameter from the dummy resistor;
- programming the parameter into the nonvolatile memory, wherein during startup of the optical mouse, the optical mouse sensor is programmed with the parameter from the nonvolatile memory and drives the laser accordingly.