Keypad wait interrupt
Moderator: Benj
Keypad wait interrupt
I do not want to wait for the input for long time. If the input is there in keypad its fine, else the program must carry on. What should I do make such program?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Keypad wait interrupt
Hello,
The Interrupt On Change (IOC) type interrupt can be used to detect a I/O change.
However a keypad is generally raster scanned so probably won't work with the IOC interrupt unless you get the changing voltage to be made present to the micro via your circuitry.
A lot of devices would wait for up to say 30 seconds for input before resuming with what they were doing.
This can be done by incrementing a counter in a loop every time there is no keypress along with a delay. If the counter reaches a certain value then x amount of time has passed and you can drop out of the loop and go back to what you were doing before. By placing this type of code into a macro you can call it in several places in your program without repeating the same code over and over again.
The Interrupt On Change (IOC) type interrupt can be used to detect a I/O change.
However a keypad is generally raster scanned so probably won't work with the IOC interrupt unless you get the changing voltage to be made present to the micro via your circuitry.
A lot of devices would wait for up to say 30 seconds for input before resuming with what they were doing.
This can be done by incrementing a counter in a loop every time there is no keypress along with a delay. If the counter reaches a certain value then x amount of time has passed and you can drop out of the loop and go back to what you were doing before. By placing this type of code into a macro you can call it in several places in your program without repeating the same code over and over again.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel