Compare commits
No commits in common. "6afab56c431598aa19a1e4453ceec9471298802d" and "57ae0404927ee4f57b3d5d1a2dc3041d6d285e55" have entirely different histories.
6afab56c43
...
57ae040492
1 changed files with 1 additions and 12 deletions
|
@ -8,22 +8,11 @@ client:connect("student", "O99Rq8$F12NXzhL5caya")
|
|||
-- counter = nombre de cran tourner
|
||||
-- button = bouton poussoir
|
||||
|
||||
mot = ""
|
||||
last_clicked = 0
|
||||
function action(dir, counter, button)
|
||||
cls()
|
||||
lettre = string.char((counter % 26)+65)
|
||||
if button==1 then
|
||||
if os.time() - last_clicked > 1 then
|
||||
mot = mot..lettre
|
||||
last_clicked = os.time()
|
||||
else
|
||||
client:publish("pendu/mot", mot, mqtt.QOS0)
|
||||
mot = ""
|
||||
end
|
||||
end
|
||||
--if button==1 then
|
||||
console("Choix lettre : "..lettre)
|
||||
console("Mot : "..mot)
|
||||
end
|
||||
|
||||
enc = encoder.attach(pio.GPIO15, pio.GPIO2, pio.GPIO4, action)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue