Hello,
I would like to ask if I don't want the subroutine to be run continuously when the user didn't release the key-pad button, what should I do? I have several ideas, which one is better or else you have any better solution / method for me?
Idea (1):
Idea (2):
I would like to ask if I don't want the subroutine to be run continuously when the user didn't release the key-pad button, what should I do? I have several ideas, which one is better or else you have any better solution / method for me?
Idea (1):
Code:
main_loop:
key_detection:
(save the pressed key pattern)
key_compare:
(compare the pressed key with the saved key pattern, if they are the same, skip key_detection in the comming looping, otherwise, allows key_detection)
key_detection:
(save the pressed key pattern)
key_compare:
(compare the pressed key with the saved key pattern, if they are the same, skip key_detection in the comming looping, otherwise, allows key_detection)
Idea (2):
Code:
main_loop:
key_detection:
wait_key_release:
(do the key_detection until all the key are released)
key_detection:
wait_key_release:
(do the key_detection until all the key are released)