A nontransitory computer-readable recording medium storing a control program for an image forming apparatus, said image forming apparatus including a motor for driving said image forming apparatus, a controller for controlling said motor, and a sensor configured to sense a device state, the program causing a computer to execute processing comprising the steps of:
- a pulse generating step of generating a first pulse signal string having a frequency corresponding to a number of rotations of said motor;
- a first input receiving step of receiving an input of a logical state of said sensor, said logical state representing the device state that is not the number of rotations of said motor driving said image forming apparatus;
- a superimposing step of superimposing the first pulse signal string, which is generated in said pulse generating step, on the logical state of said sensor by modulating a duty ratio of the first pulse signal string generated in said pulse generating step based on the logical state of said sensor;
- a signal outputting step of outputting a second pulse signal string superimposed in said superimposing step, wherein the second pulse signal string is the first pulse signal string modulated in said superimposing step so that the frequency of the second pulse signal string corresponds to the number of rotations of said motor and the duty ratio of the second pulse string corresponds to the logical state of the sensor;
- a second input receiving step of receiving an input of the second pulse signal string output by said controller in said signal outputting step;
- and
- a demodulating step of obtaining the logical state of said sensor by demodulating the second pulse signal string received in said second input receiving step.