1. An electronic device, operable in a first mode and a second mode, comprising: a) a first piece; b) a second piece moveable with respect to the first piece; c) a processing circuit operable to control operation of the device; and d) a photoelectric sensor operable to sense the position of the second piece with respect to the first piece and to switch the device between the first mode and the second mode dependent upon the position of the second piece with respect to the first piece.