Abstract: A printer is provided with: a detector, operable to output an output signal in accordance with a state of a printing medium transported within the printer; and a control signal generator, operable to generate a control signal in accordance with a level of the output signal relative to a threshold. In order to control the printer, the output signal is detected. A timing signal indicative of a timing to judge the state of the printing medium is detected.