diff --git a/Affichage_lettre.lua b/Affichage_lettre.lua index 6fe6a2c..116779a 100644 --- a/Affichage_lettre.lua +++ b/Affichage_lettre.lua @@ -1,4 +1,4 @@ -client = mqtt.client("100", "mqtt.leizoour.fr", 8883, true) +client = mqtt.client("100", "mqtt.leizour.fr", 8883, true) client:connect("student", "O99Rq8$F12NXzhL5caya") -- CLK (clock) : D19 @@ -11,8 +11,10 @@ client:connect("student", "O99Rq8$F12NXzhL5caya") function action(dir, counter, button) cls() lettre = string.char((counter % 26)+65) - --if button==1 then - console("Choix lettre : "....lettre) + if button==1 then + client:subscribe("pendu",mqtt.QOS0,lettre) + end + console("Choix lettre : "..lettre) end enc = encoder.attach(pio.GPIO19,pio.GPIO21,pio.GPIO23,action)