摘要 |
PROBLEM TO BE SOLVED: To prevent the influence of the chattering of a mechanical switch and external noise by performing a specific interruption process when the interval between edges of an interruption signal is in the range of a predetermined time. SOLUTION: When the mechanical switch 30 is pressed and the interruption signal varies from High to Low, a CPU 10 detects a trailing edge of the interruption signal (INT) and starts a timer. When the interruption signal is inputted for the second time, the change of the switch 30 is caused by misoperation or chattering and ignored on condition that the clocking time of the timer is <=0.2 second. The timer is restarted 0.2 second later. When the operator puts the hand away from the switch 30, the interruption signal has an edge changing from Low to High. An interruption processing program turns ON the function to be executed by the switch depression when the clocking result of the timer is <=3 seconds.
|