How to debounce a button?
Author |
Message |
T.O
|
Posted: Tue Jun 09, 2009 8:07 am Post subject: How to debounce a button? |
|
|
What is it you are trying to achieve?
see topic
What is the problem you are having?
see topic
Describe what you have tried to solve this problem
everything
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
loop
Mouse.Where (mousex, mousey, button )
locatexy (10, 10)
put mousex, " ", mousey, " ", button, " " ..
delay (30)
if mousex > 32 and mousex < 64 and button = 1 then
guessing (a, 1) := guessing (a, 1) + 1
end if
if guessing (a, 1) > teams then
guessing (a, 1) := 1
end if
delay (30)
if mousex > 69 and mousex < 101 and button = 1 then
guessing (a, 2) := guessing (a, 2) + 1
end if
if guessing (a, 2) > teams then
guessing (a, 2) := 1
end if
delay (30)
if mousex > 104 and mousex < 135 and button = 1 then
guessing (a, 3) := guessing (a, 3) + 1
end if
if guessing (a, 3) > teams then
guessing (a, 3) := 1
end if
delay (30)
if mousex > 139 and mousex < 168 and button = 1 then
guessing (a, 4) := guessing (a, 4) + 1
end if
if guessing (a, 4) > teams then
guessing (a, 4) := 1
end if
% output results
|
Please specify what version of Turing you are using
4.1.1
Description: |
|
Download |
Filename: |
mastermind v 29 gui.t |
Filesize: |
25.75 KB |
Downloaded: |
94 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|