for instance in the case where 34 five stitches 34 is set as was described before immediately after the stitching operation starts the number of stitches 34 5 34 is stored in the memory means when the cloth is sewn two stitches the number of stitches 34 3 34 is stored in the manner the stitching operation is continued until the number of stitches set in the memory means is zeroed in order to allow the microprocessor to operate the above described equations 1 through 11 the memory means 18 stores the following data a in the case when the reverse stitching solenoid is in the 34 on 34 state r 0 the resistance of the solenoid at a temperature t 0 b in the case when the reverse stitching solenoid 28 is in 34 off 34 state the above described values of e i 0 r 0 and l are stored for equation 11 in the case of the equation 6 or 11 it is necessary to calculate the natural logarithm of a number of values a data table of the logarithms of these values may be stored in the memory means in advance examples of the temperature detecting means 30 are a thermister which may be either of positive characteristic or of negative characteristic a thermocouple made of copper and 34 constantan 34 for instance an infrared detecting element which performs measurement through the quantity of infrared radiated energy and a semiconductor detecting element these examples are conventional ones and their detailed descriptions will not be made in detecting a temperature with a semiconductor detecting element since its voltage or resistance is in general non linear with respect to temperature it is preferable to additionally employ means for correcting the non.