From 52c504769941fbcfe191c723d3adf7a59f7fb608 Mon Sep 17 00:00:00 2001 From: Lukian Date: Sat, 12 Oct 2024 21:53:58 +0200 Subject: [PATCH 1/9] commit --- autorun.lua | 5 ++- encoder.lua | 41 +++++++++++++++++++++++ main.lua | 2 ++ neopixel.lua | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++ out.lua | 34 +++++++++++++------ pwm.lua | 35 ++++++++++++++++++++ 6 files changed, 199 insertions(+), 11 deletions(-) create mode 100644 encoder.lua create mode 100644 neopixel.lua create mode 100644 pwm.lua diff --git a/autorun.lua b/autorun.lua index bd6fb78..7eb3cfe 100644 --- a/autorun.lua +++ b/autorun.lua @@ -1,7 +1,10 @@ -- charge le fichier principal dofile("main.lua") +dofile("neopixel.lua") +dofile("encoder.lua") -- affiche la température du CPU printTemp() - +-- affiche le résultat du dé sur le neopixel +-- dice() diff --git a/encoder.lua b/encoder.lua new file mode 100644 index 0000000..e8f27cb --- /dev/null +++ b/encoder.lua @@ -0,0 +1,41 @@ +-- écrit par Lukian Leizour le 12/10/2024 + +function print_pos() + enc = encoder.attach(pio.GPIO18, pio.GPIO19, pio.GPIO21, function(dir, counter, button) + print(dir, counter, button) + end) +end + +function scroll() + neo = neopixel.attach(neopixel.WS2812B, pio.GPIO22, 8) + pos = 0 + + enc = encoder.attach(pio.GPIO18, pio.GPIO19, pio.GPIO21, function(dir, counter, button) + neo:setPixel(pos, 0, 0, 0) + if (dir == 1) then pos = (pos + 1) % 8 + elseif (dir == -1) then pos = (pos - 1) % 8 end + r, g, b = wheelRGB(math.random(0, 255)) + neo:setPixel(pos, r//10, g//10, b//10) + neo:update() + end) +end + +function led_on_off() + on = false + enc = encoder.attach(pio.GPIO18, pio.GPIO19, pio.GPIO21, function(dir, counter, button) + if button == 1 then on = not on end + if on then pinon(pio.GPIO2) else pinoff(pio.GPIO2) end + end) +end + +function led_speed() + device = pwm.attach(pio.GPIO2, 1, 0.5) + device:start() + pos = 1 + + enc = encoder.attach(pio.GPIO18, pio.GPIO19, pio.GPIO21, function(dir, counter, button) + if (dir == 1) then pos = pos + 1 + elseif (dir == -1 and pos > 1) then pos = (pos - 1) end + device:setfreq(pos) + end) +end diff --git a/main.lua b/main.lua index 97e19b5..a56b80e 100755 --- a/main.lua +++ b/main.lua @@ -1,5 +1,7 @@ -- charge les fonctions du fichier out.lua dofile("out.lua") +dofile("neopixel.lua") +dofile("encoder.lua") -- fonction permettant d'afficher la température du CPU function printTemp() diff --git a/neopixel.lua b/neopixel.lua new file mode 100644 index 0000000..7c4480d --- /dev/null +++ b/neopixel.lua @@ -0,0 +1,93 @@ +-- écrit le 12/10/2024 par Lukian Leizour + +function feux() + neo = neopixel.attach(neopixel.WS2812B, pio.GPIO18, 8) + + while true do + neo:setPixel(7, 255, 0, 0) + neo:update() + + tmr.delayms(3000) + + neo:setPixel(7, 0, 0, 0) + neo:setPixel(5, 0, 255, 0) + neo:update() + + tmr.delayms(3000) + + neo:setPixel(5, 0, 0, 0) + neo:setPixel(6, 255, 255, 0) + neo:update() + + tmr.delayms(1000) + + neo:setPixel(6, 0, 0, 0) + end +end + +function wheelRGB(pos) + pos = 255 - pos + if (pos < 85) then + return 255 - pos * 3, 0, pos * 3 + elseif (pos < 170) then + pos = pos - 85 + return 0, pos * 3, 255 - pos * 3 + else + pos = pos - 170 + return pos * 3, 255 - pos * 3, 0 + end +end + +function arc() + neo = neopixel.attach(neopixel.WS2812B, pio.GPIO18, 8) + for i=0,7 do + r, g, b = wheelRGB((255*i) // 8) + neo:setPixel(i, r//10, g//10, b//10) + end + neo:update() +end + +function arc_move() + neo = neopixel.attach(neopixel.WS2812B, pio.GPIO18, 8) + pixel = 0 + direction = 0 + + while true do + r, g, b = wheelRGB((255*pixel) // 8) + neo:setPixel(pixel, r, g, b) + neo:update() + tmr.delayms(100) + neo:setPixel(pixel, r//10, g//10, b//10) + if (direction == 0) then + if (pixel == 7) then + direction = 1; pixel = 6 + else + pixel = pixel + 1 + end + else + if (pixel == 0) then + direction = 0; pixel = 1 + else + pixel = pixel - 1 + end + end + end +end + +function fete() + neo = neopixel.attach(neopixel.WS2812B, pio.GPIO18, 8) + while true do + r, g, b = wheelRGB(math.random(0, 255)) + neo:setPixel(math.random(0, 7), r, g, b) + neo:update() + tmr.delayms(50) + end +end + +function dice() -- on note que le dé renvoie toujours la même valeur étant donné qu'il est appelé au démarage et que math.random() a comme seed l'uptime de l'ESP32 + for i=0,math.random(0, 7) do + r, g, b = wheelRGB((255*i) // 8) + neo:setPixel(i, r, g, b) + neo:update() + end +end diff --git a/out.lua b/out.lua index 05a5ea5..0f0ed78 100644 --- a/out.lua +++ b/out.lua @@ -57,21 +57,35 @@ function smooth() tmr.delayms(200) i = i - 0.05 end - device:stop()² + device:stop() +end - red:start() - green:start() - blue:start() +function rgb(r, g, b) + red = pwm.attach(pio.GPIO21, 2000, r / 256); red:start() + green = pwm.attach(pio.GPIO19, 2000, g / 256); green:start() + blue = pwm.attach(pio.GPIO18, 2000, b / 256); blue:start() tmr.delayms(5000) - red:stop() - green:stop() - blue:stop() + red:stop(); red:detach() + green:stop(); green:detach() + blue:stop(); blue:detach() +end - red:detach() - green:detach() - blue:detach() +function allrgb() + red = pwm.attach(pio.GPIO21, 2000, 1.); red:start() + green = pwm.attach(pio.GPIO19, 2000, 0); green:start() + blue = pwm.attach(pio.GPIO18, 2000, 0); blue:start() + + for i=0,255,5 do green:setduty(i / 256); tmr.delayms(50) end + for i=255,0,-5 do red:setduty(i / 256); tmr.delayms(50) end + for i=0,255,5 do blue:setduty(i / 256); tmr.delayms(50) end + for i=255,0,-5 do green:setduty(i / 256); tmr.delayms(50) end + for i=0,255,5 do red:setduty(i / 256); tmr.delayms(50) end + + red:stop(); red:detach() + green:stop(); green:detach() + blue:stop(); blue:detach() end -- fonction permettant d'allumer un buzzer pendant un temps donné diff --git a/pwm.lua b/pwm.lua new file mode 100644 index 0000000..935c9dd --- /dev/null +++ b/pwm.lua @@ -0,0 +1,35 @@ +-- écrit le 12/10/2024 par Lukian Leizour + +function rgb(r, g, b) + -- on attache et démarre les pins + red = pwm.attach(pio.GPIO21, 2000, r / 256); red:start() + green = pwm.attach(pio.GPIO19, 2000, g / 256); green:start() + blue = pwm.attach(pio.GPIO18, 2000, b / 256); blue:start() + + -- on attend 5 secondes + tmr.delayms(5000) + + -- on stoppe et détache les pins + red:stop(); red:detach() + green:stop(); green:detach() + blue:stop(); blue:detach() +end + +function allrgb() + -- on attache et démarre les pins + red = pwm.attach(pio.GPIO21, 2000, 1.); red:start() + green = pwm.attach(pio.GPIO19, 2000, 0); green:start() + blue = pwm.attach(pio.GPIO18, 2000, 0); blue:start() + + -- on boucle pour afficher toutes les couleurs RGB + for i=0,255,5 do green:setduty(i / 256); tmr.delayms(50) end + for i=255,0,-5 do red:setduty(i / 256); tmr.delayms(50) end + for i=0,255,5 do blue:setduty(i / 256); tmr.delayms(50) end + for i=255,0,-5 do green:setduty(i / 256); tmr.delayms(50) end + for i=0,255,5 do red:setduty(i / 256); tmr.delayms(50) end + + -- on stoppe et détache les pins + red:stop(); red:detach() + green:stop(); green:detach() + blue:stop(); blue:detach() +end \ No newline at end of file From 84036b5d43afbb58bba19ff32f4b4fa761743a4b Mon Sep 17 00:00:00 2001 From: Lukian Date: Tue, 22 Oct 2024 19:00:30 +0200 Subject: [PATCH 2/9] commit --- dht22.lua | 22 ++++++++++++++++++++++ main.lua | 1 + 2 files changed, 23 insertions(+) create mode 100644 dht22.lua diff --git a/dht22.lua b/dht22.lua new file mode 100644 index 0000000..3d39f96 --- /dev/null +++ b/dht22.lua @@ -0,0 +1,22 @@ +function print_temp() + s = sensor.attach("DHT22", pio.GPIO18) + tmr.delayms(500) + while true do + print("Temperature : "..s:read("temperature").." Humitité : "..s:read("humidity")) + tmr.delayms(500) + end +end + +function humi_neo(min, max) + s = sensor.attach("DHT22", pio.GPIO18) + neo = neopixel.attach(neopixel.WS2812B, pio.GPIO19, 8) + tmr.delayms(500) + pos = 0 + while true do + neo:setPixel(pos, 0, 0, 0) + pos = math.floor((s:read("humidity") - min)/(max - min) * 8) + neo:setPixel(pos, 240, 150, 140) + neo:update() + tmr.delayms(500) + end +end diff --git a/main.lua b/main.lua index a56b80e..b68ca51 100755 --- a/main.lua +++ b/main.lua @@ -2,6 +2,7 @@ dofile("out.lua") dofile("neopixel.lua") dofile("encoder.lua") +dofile("dht22.lua") -- fonction permettant d'afficher la température du CPU function printTemp() From 068d3a6f7048e8a40ae8cae37056f08d4bcfb173 Mon Sep 17 00:00:00 2001 From: Lukian Date: Tue, 22 Oct 2024 23:25:38 +0200 Subject: [PATCH 3/9] commit --- dht22.lua | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/dht22.lua b/dht22.lua index 3d39f96..060a8d9 100644 --- a/dht22.lua +++ b/dht22.lua @@ -1,3 +1,5 @@ +-- écrit par Lukian Leizour le 22/10/2024 + function print_temp() s = sensor.attach("DHT22", pio.GPIO18) tmr.delayms(500) @@ -20,3 +22,56 @@ function humi_neo(min, max) tmr.delayms(500) end end + +function min(tab) + local min = tab[1] + for i=1,#tab do + if tab[i] < min then min = tab[i] end + end + return min +end + +function max(tab) + local max = tab[1] + for i=1,#tab do + if tab[i] > max then max = tab[i] end + end + return max +end + +function avg(tab) + local sum = 0 + for i=1,#tab do + sum = sum + tab[i] + end + return sum / #tab +end + +function temp_humi_avg() + temps = {} + humis = {} + s = sensor.attach("DHT22", pio.GPIO18) + device = pwm.attach(pio.GPIO2, 3, 0.5) + blinking = false + tmr.delayms(500) + while true do + temp = s:read("temperature") + humi = s:read("humidity") + if #temps == 10 then + for i=1,9 do + temps[i] = temps[i + 1] + humis[i] = humis[i + 1] + end + temps[10] = temp + humis[10] = humi + else + temps[#temps + 1] = temp + humis[#humis + 1] = humi + end + print("temp: "..temp..", min temp: "..min(temps)..", max temp: "..max(temps)..", avg temp: "..avg(temps)) + print("humi: "..humi..", min humi: "..min(humis)..", max humi: "..max(humis)..", avg humi: "..avg(humis).."\n") + if humi > avg(humis) and not blinking then device:start(); blinking = true + elseif humi <= avg(humis) and blinking then device:stop(); blinking = false end + tmr.delayms(10000) + end +end From e92123ab2277546b40b1d71d77546278d65308d0 Mon Sep 17 00:00:00 2001 From: Lukian Date: Wed, 23 Oct 2024 20:08:41 +0200 Subject: [PATCH 4/9] commit --- autorun.lua | 3 +- buzz.lua | 27 ++++++++++ dht22.lua | 2 +- leds.lua | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++ main.lua | 30 ++++++++--- neopixel.lua | 13 ----- out.lua | 120 ++------------------------------------------ pwm.lua | 35 ------------- screen.lua | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 328 insertions(+), 174 deletions(-) create mode 100644 buzz.lua create mode 100644 leds.lua delete mode 100644 pwm.lua create mode 100644 screen.lua diff --git a/autorun.lua b/autorun.lua index 7eb3cfe..1fa2846 100644 --- a/autorun.lua +++ b/autorun.lua @@ -1,7 +1,6 @@ -- charge le fichier principal +dofile('out.lua') dofile("main.lua") -dofile("neopixel.lua") -dofile("encoder.lua") -- affiche la température du CPU printTemp() diff --git a/buzz.lua b/buzz.lua new file mode 100644 index 0000000..6891c62 --- /dev/null +++ b/buzz.lua @@ -0,0 +1,27 @@ +-- écrit le 23/10/2024 par Lukian Leizour +-- ce programme doit tourner sur un ESP32 sous LUARTOS + +-- fonction permettant d'allumer un buzzer pendant un temps donné +function buzz(pin, delay) -- pin : la patte sur laquelle le buzzer est connecté; delay : le temps pendant lequel le buzzer reste allumé + pinon(pin) -- on allume le buzzer + tmr.delayms(delay) -- on attend pendand le temps désiré + pinoff(pin) -- on étteint le buzzer une fois la durée atteinte +end + +-- fonction permettant de faire "clignoter" un buzzer sur un pin donné pour une durée donnée et un nombre d'itérations donné +function blink_buzz(pin, n, delay) -- pin : la patte du buzzer; n : le nombre d'itérations; delay : le délai en ms + for i=1,n do + buzz(pin, delay) -- on allume le buzzer pendant la durée désirée + tmr.delayms(delay) -- on attend avant de passer à la suite + end +end + +-- fonction qui envoie un signal SOS sonore sur un buzzer branché sur la patte D18 de l'ESP32 +function sos_buzz(n) -- n : nombre de fois qu'on fait le signal SOS + for i=1,n do + pinblink_buzz(pio.GPIO18, 3, 400) -- on clignotte 3 fois longuement + pinblink_buzz(pio.GPIO18, 3, 200) -- on clignotte 3 fois courtement + pinblink_buzz(pio.GPIO18, 3, 400) -- on clignotte 3 fois longuement + tmr.delayms(400) -- on fait une longue pause de 400ms + end +end diff --git a/dht22.lua b/dht22.lua index 060a8d9..8811c12 100644 --- a/dht22.lua +++ b/dht22.lua @@ -1,4 +1,4 @@ --- écrit par Lukian Leizour le 22/10/2024 +-- écrit par Lukian Leizour le 22/10/2024x function print_temp() s = sensor.attach("DHT22", pio.GPIO18) diff --git a/leds.lua b/leds.lua new file mode 100644 index 0000000..6606228 --- /dev/null +++ b/leds.lua @@ -0,0 +1,135 @@ +-- écrit le 23/10/2024 par Lukian Leizour +-- ce programme doit tourner sur un ESP32 sous LUARTOS + +-- fonction permettant d'allumer la led bleue du du circuit de l'ESP32 +function ledon() + pinon(pio.GPIO2) +end + +-- fonction permettant d'étteindre la led bleue du du circuit de l'ESP32 +function ledoff() + pinoff(pio.GPIO2) +end + +-- fonction permettant de faire clignoter la led bleue du circuit de l'ESP32 +function blink(n) -- pin : la patte de sortie; n : int, nombre d'itérations + pinblink(pio.GPIO2, n, 200) -- appel de la fonciton blink en lui donnant la bonne patte en paramètre ainsi que le temps d'éclairage +end + +-- fonction permettant de faire clignoter la led sur la pin 18 4 fois brièvement +function blink_pwm1() + device = pwm.attach(pio.GPIO18, 1, 0.2) -- 1Hz et 20% de signal "haut" + device:start() -- départ + tmr.delayms(4000) -- on attend que la led ait finit de clignoter + device:stop() -- on arrête le signal + device:detach() -- on se détache de la pin +end + +-- fonction permettant de faire clignoter la led sur la pin 18 4 fois longuement +function blink_pwm2() + device = pwm.attach(pio.GPIO18, 1, 0.8) -- 1Hz et 80% de signal "haut" + device:start() -- départ + tmr.delayms(4000) -- on attend que la led ait finit de clignoter + device:stop() -- on arrête le signal + device:detach() -- on se détache de la pin +end + +-- fonction permettant d'allumer et étteindre progressivement une led sur la pin 18 +function smooth() + device = pwm.attach(pio.GPIO18, 200, 0) + device:start() + i = 0 + while i <= 1 do + device:setduty(i) + tmr.delayms(200) + i = i + 0.05 + end + i = 1. + while i >= 0 do + device:setduty(i) + tmr.delayms(200) + i = i - 0.05 + end + device:stop() +end + +function rgb(r, g, b) + red = pwm.attach(pio.GPIO21, 2000, r / 256); red:start() + green = pwm.attach(pio.GPIO19, 2000, g / 256); green:start() + blue = pwm.attach(pio.GPIO18, 2000, b / 256); blue:start() + + tmr.delayms(5000) + + red:stop(); red:detach() + green:stop(); green:detach() + blue:stop(); blue:detach() +end + +function allrgb() + red = pwm.attach(pio.GPIO21, 2000, 1.); red:start() + green = pwm.attach(pio.GPIO19, 2000, 0); green:start() + blue = pwm.attach(pio.GPIO18, 2000, 0); blue:start() + + for i=0,255,5 do green:setduty(i / 256); tmr.delayms(50) end + for i=255,0,-5 do red:setduty(i / 256); tmr.delayms(50) end + for i=0,255,5 do blue:setduty(i / 256); tmr.delayms(50) end + for i=255,0,-5 do green:setduty(i / 256); tmr.delayms(50) end + for i=0,255,5 do red:setduty(i / 256); tmr.delayms(50) end + + red:stop(); red:detach() + green:stop(); green:detach() + blue:stop(); blue:detach() +end + +-- fonction permettant d'afficher successivement les clouleurs Rouge, Vert et Bleu en connectant la led RGB sur les pins D18, D19 et D21 +function triColors(n) -- n : nombre de fois qu'on réalise le paterne + for i=1,n do + pinblink(pio.GPIO21, 1, 200) -- appel de la fonciton blink pour faire clignoter une fois la led en rouge pendant 200ms + pinblink(pio.GPIO19, 1, 200) -- appel de la fonciton blink pour faire clignoter une fois la led en vert pendant 200ms + pinblink(pio.GPIO18, 1, 200) -- appel de la fonciton blink pour faire clignoter une fois la led en bleu pendant 200ms + end +end + +-- fonction qui envoie un signal SOS lumineux sur la led bleu du circuit de l'ESP32 +function sos_led(n) -- n : nombre de fois qu'on affiche le signal SOS + for i=1,n do + pinblink(pio.GPIO2, 3, 400) -- on clignotte 3 fois longuement + pinblink(pio.GPIO2, 3, 200) -- on clignotte 3 fois courtement + pinblink(pio.GPIO2, 3, 400) -- on clignotte 3 fois longuement + tmr.delayms(400) -- on fait une longue pause de 400ms + end +end + +function rgb(r, g, b) + -- on attache et démarre les pins + red = pwm.attach(pio.GPIO21, 2000, r / 256); red:start() + green = pwm.attach(pio.GPIO19, 2000, g / 256); green:start() + blue = pwm.attach(pio.GPIO18, 2000, b / 256); blue:start() + + -- on attend 5 secondes + tmr.delayms(5000) + + -- on stoppe et détache les pins + red:stop(); red:detach() + green:stop(); green:detach() + blue:stop(); blue:detach() +end + +function allrgb() + -- on attache et démarre les pins + red = pwm.attach(pio.GPIO21, 2000, 1.); red:start() + green = pwm.attach(pio.GPIO19, 2000, 0); green:start() + blue = pwm.attach(pio.GPIO18, 2000, 0); blue:start() + + -- on boucle pour afficher toutes les couleurs RGB + for i=0,255,5 do green:setduty(i / 256); tmr.delayms(50) end + for i=255,0,-5 do red:setduty(i / 256); tmr.delayms(50) end + for i=0,255,5 do blue:setduty(i / 256); tmr.delayms(50) end + for i=255,0,-5 do green:setduty(i / 256); tmr.delayms(50) end + for i=0,255,5 do red:setduty(i / 256); tmr.delayms(50) end + + -- on stoppe et détache les pins + red:stop(); red:detach() + green:stop(); green:detach() + blue:stop(); blue:detach() +end diff --git a/main.lua b/main.lua index b68ca51..d4d4eb8 100755 --- a/main.lua +++ b/main.lua @@ -1,10 +1,28 @@ --- charge les fonctions du fichier out.lua -dofile("out.lua") -dofile("neopixel.lua") -dofile("encoder.lua") -dofile("dht22.lua") +-- programme principal qui charge les fonctions des autres programmes + +-- fonction de roue RGB +function wheelRGB(pos) -- pos 0 -> 255 couleur + pos = 255 - pos + if (pos < 85) then + return 255 - pos * 3, 0, pos * 3 + elseif (pos < 170) then + pos = pos - 85 + return 0, pos * 3, 255 - pos * 3 + else + pos = pos - 170 + return pos * 3, 255 - pos * 3, 0 + end +end -- fonction permettant d'afficher la température du CPU function printTemp() print("Température du CPU :", cpu.temperature()) -end \ No newline at end of file +end + +-- charge tout nos fichiers lua +dofile("leds.lua") +dofile("buzz.lua") +dofile("neopixel.lua") +dofile("encoder.lua") +dofile("dht22.lua") +dofile("screen.lua") diff --git a/neopixel.lua b/neopixel.lua index 7c4480d..a4021bf 100644 --- a/neopixel.lua +++ b/neopixel.lua @@ -25,19 +25,6 @@ function feux() end end -function wheelRGB(pos) - pos = 255 - pos - if (pos < 85) then - return 255 - pos * 3, 0, pos * 3 - elseif (pos < 170) then - pos = pos - 85 - return 0, pos * 3, 255 - pos * 3 - else - pos = pos - 170 - return pos * 3, 255 - pos * 3, 0 - end -end - function arc() neo = neopixel.attach(neopixel.WS2812B, pio.GPIO18, 8) for i=0,7 do diff --git a/out.lua b/out.lua index 0f0ed78..b786172 100644 --- a/out.lua +++ b/out.lua @@ -2,19 +2,19 @@ -- ce programme doit tourner sur un ESP32 sous LUARTOS -- fonction permettant d'allumer une led sur l'ESP32 sur une patte donnée -function pinon (pin) -- pin : la patte sur laquelle la led est branchée +function pinon(pin) -- pin : la patte sur laquelle la led est branchée pio.pin.setdir(pio.OUTPUT, pin) -- permet d'indiquer que la patte sert de sortie pio.pin.sethigh(pin) -- permet de mettre la tension au max end -- fonction permettant d'eteindre une led sur l'ESP32 sur une patte donnée -function pinoff (pin) -- pin : la patte sur laquelle la led est branchée +function pinoff(pin) -- pin : la patte sur laquelle la led est branchée pio.pin.setdir(pio.OUTPUT, pin) -- permet d'indiquer que la patte GPIO2 sert de sortie pio.pin.setlow(pin) -- permet de mettre la tension au minimum end -- fonction permettant de faire clignoter la led de l'ESP32 -function blink (pin, n, delay) -- pin : la patte de sortie; n : int, nombre d'itérations; delay : le temps en ms que la led reste allumé et étteinte +function pinblink (pin, n, delay) -- pin : la patte de sortie; n : int, nombre d'itérations; delay : le temps en ms que la led reste allumé et étteinte for i=1,n do pinon(pin) -- appel de la fonction ledon tmr.delayms(delay) -- le programme attend en fonction du délai donné @@ -22,117 +22,3 @@ function blink (pin, n, delay) -- pin : la patte de sortie; n : int, nombre d'it tmr.delayms(delay) -- le programme attend en fonction du délai donné end end - --- fonction permettant de faire clignoter la led sur la pin 18 4 fois brièvement -function blink_pwm1() - device = pwm.attach(pio.GPIO18, 1, 0.2) -- 1Hz et 20% de signal "haut" - device:start() -- départ - tmr.delayms(4000) -- on attend que la led ait finit de clignoter - device:stop() -- on arrête le signal - device:detach() -- on se détache de la pin -end - --- fonction permettant de faire clignoter la led sur la pin 18 4 fois longuement -function blink_pwm2() - device = pwm.attach(pio.GPIO18, 1, 0.8) -- 1Hz et 80% de signal "haut" - device:start() -- départ - tmr.delayms(4000) -- on attend que la led ait finit de clignoter - device:stop() -- on arrête le signal - device:detach() -- on se détache de la pin -end - --- fonction permettant d'allumer et étteindre progressivement une led sur la pin 18 -function smooth() - device = pwm.attach(pio.GPIO18, 200, 0) - device:start() - i = 0 - while i <= 1 do - device:setduty(i) - tmr.delayms(200) - i = i + 0.05 - end - i = 1. - while i >= 0 do - device:setduty(i) - tmr.delayms(200) - i = i - 0.05 - end - device:stop() -end - -function rgb(r, g, b) - red = pwm.attach(pio.GPIO21, 2000, r / 256); red:start() - green = pwm.attach(pio.GPIO19, 2000, g / 256); green:start() - blue = pwm.attach(pio.GPIO18, 2000, b / 256); blue:start() - - tmr.delayms(5000) - - red:stop(); red:detach() - green:stop(); green:detach() - blue:stop(); blue:detach() -end - -function allrgb() - red = pwm.attach(pio.GPIO21, 2000, 1.); red:start() - green = pwm.attach(pio.GPIO19, 2000, 0); green:start() - blue = pwm.attach(pio.GPIO18, 2000, 0); blue:start() - - for i=0,255,5 do green:setduty(i / 256); tmr.delayms(50) end - for i=255,0,-5 do red:setduty(i / 256); tmr.delayms(50) end - for i=0,255,5 do blue:setduty(i / 256); tmr.delayms(50) end - for i=255,0,-5 do green:setduty(i / 256); tmr.delayms(50) end - for i=0,255,5 do red:setduty(i / 256); tmr.delayms(50) end - - red:stop(); red:detach() - green:stop(); green:detach() - blue:stop(); blue:detach() -end - --- fonction permettant d'allumer un buzzer pendant un temps donné -function buzz(pin, delay) -- pin : la patte sur laquelle le buzzer est connecté; delay : le temps pendant lequel le buzzer reste allumé - pinon(pin) -- on allume le buzzer - tmr.delayms(delay) -- on attend pendand le temps désiré - pinoff(pin) -- on étteint le buzzer une fois la durée atteinte -end - --- fonction permettant de faire "clignoter" un buzzer sur un pin donné pour une durée donnée et un nombre d'itérations donné -function blink_buzz(pin, n, delay) -- pin : la patte du buzzer; n : le nombre d'itérations; delay : le délai en ms - for i=1,n do - buzz(pin, delay) -- on allume le buzzer pendant la durée désirée - tmr.delayms(delay) -- on attend avant de passer à la suite - end -end - --- fonction permettant de faire clignoter la led bleu du circuit de l'ESP32 -function blink_2(n) -- pin : la patte de sortie; n : int, nombre d'itérations - blink(pio.GPIO2, n, 200) -- appel de la fonciton blink en lui donnant la bonne patte en paramètre ainsi que le temps d'éclairage -end - --- fonction permettant d'afficher successivement les clouleurs Rouge, Vert et Bleu en connectant la led RGB sur les pins D18, D19 et D21 -function triColors(n) -- n : nombre de fois qu'on réalise le paterne - for i=1,n do - blink(pio.GPIO21, 1, 200) -- appel de la fonciton blink pour faire clignoter une fois la led en rouge pendant 200ms - blink(pio.GPIO19, 1, 200) -- appel de la fonciton blink pour faire clignoter une fois la led en vert pendant 200ms - blink(pio.GPIO18, 1, 200) -- appel de la fonciton blink pour faire clignoter une fois la led en bleu pendant 200ms - end -end - --- fonction qui envoie un signal SOS lumineux sur la led bleu du circuit de l'ESP32 -function sos_led(n) -- n : nombre de fois qu'on affiche le signal SOS - for i=1,n do - blink(pio.GPIO2, 3, 400) -- on clignotte 3 fois longuement - blink(pio.GPIO2, 3, 200) -- on clignotte 3 fois courtement - blink(pio.GPIO2, 3, 400) -- on clignotte 3 fois longuement - tmr.delayms(400) -- on fait une longue pause de 400ms - end -end - --- fonction qui envoie un signal SOS sonore sur un buzzer branché sur la patte D18 de l'ESP32 -function sos_buzz(n) -- n : nombre de fois qu'on fait le signal SOS - for i=1,n do - blink_buzz(pio.GPIO18, 3, 400) -- on clignotte 3 fois longuement - blink_buzz(pio.GPIO18, 3, 200) -- on clignotte 3 fois courtement - blink_buzz(pio.GPIO18, 3, 400) -- on clignotte 3 fois longuement - tmr.delayms(400) -- on fait une longue pause de 400ms - end -end diff --git a/pwm.lua b/pwm.lua deleted file mode 100644 index 935c9dd..0000000 --- a/pwm.lua +++ /dev/null @@ -1,35 +0,0 @@ --- écrit le 12/10/2024 par Lukian Leizour - -function rgb(r, g, b) - -- on attache et démarre les pins - red = pwm.attach(pio.GPIO21, 2000, r / 256); red:start() - green = pwm.attach(pio.GPIO19, 2000, g / 256); green:start() - blue = pwm.attach(pio.GPIO18, 2000, b / 256); blue:start() - - -- on attend 5 secondes - tmr.delayms(5000) - - -- on stoppe et détache les pins - red:stop(); red:detach() - green:stop(); green:detach() - blue:stop(); blue:detach() -end - -function allrgb() - -- on attache et démarre les pins - red = pwm.attach(pio.GPIO21, 2000, 1.); red:start() - green = pwm.attach(pio.GPIO19, 2000, 0); green:start() - blue = pwm.attach(pio.GPIO18, 2000, 0); blue:start() - - -- on boucle pour afficher toutes les couleurs RGB - for i=0,255,5 do green:setduty(i / 256); tmr.delayms(50) end - for i=255,0,-5 do red:setduty(i / 256); tmr.delayms(50) end - for i=0,255,5 do blue:setduty(i / 256); tmr.delayms(50) end - for i=255,0,-5 do green:setduty(i / 256); tmr.delayms(50) end - for i=0,255,5 do red:setduty(i / 256); tmr.delayms(50) end - - -- on stoppe et détache les pins - red:stop(); red:detach() - green:stop(); green:detach() - blue:stop(); blue:detach() -end \ No newline at end of file diff --git a/screen.lua b/screen.lua new file mode 100644 index 0000000..dba744e --- /dev/null +++ b/screen.lua @@ -0,0 +1,137 @@ +-- introduction IOT / UBS +-- (c) Gildas Menier +-- gildas.menier@univ-ubs.fr + +-- contient les définitions de +-- cls() +-- console() + +-- changer les valeurs qui suivent en fonction de +-- vos branchements + +-- GPIO pour I2C +local sda = 18 +local scl = 19 + +-- adresse ecran I2C +i2cadd = 0x3C + +-- configuration +local reset16 = false -- reset ecran +i2c.setpins(0,sda,scl) -- config i2C + +-- ecran +if reset16 then -- reset pour l'ecran si necessaire + pio.pin.setdir(pio.OUTPUT, pio.GPIO16); + pio.pin.setlow(pio.GPIO16) + tmr.delayms(50); + pio.pin.sethigh(pio.GPIO16) + tmr.delayms(50); +end + +pcall( function() -- pas d'erreur + gdisplay.attach(gdisplay.SSD1306_128_64, gdisplay.LANDSCAPE, false, i2cadd) + gdisplay.clear() + gdisplay.setfont(gdisplay.FONT_LCD) + gdisplay.setwrap(false) +end) + +local consolepos = 0 +local consoletab = {} +local consolemax = 6 + +local oledflip = 1 + +function flip() + oledflip = oledflip+1; if oledflip > 3 then oledflip = 0 end + if oledflip==0 then + consolemax = 6 + gdisplay.attach(gdisplay.SSD1306_128_64, gdisplay.LANDSCAPE_FLIP, false, i2cadd) + elseif oledflip==1 then + consolemax = 6 + gdisplay.attach(gdisplay.SSD1306_128_64, gdisplay.LANDSCAPE, false, i2cadd) + elseif oledflip==2 then + consolemax = 13 + gdisplay.attach(gdisplay.SSD1306_128_64, gdisplay.PORTRAIT, false, i2cadd) + else + consolemax = 13 + gdisplay.attach(gdisplay.SSD1306_128_64, gdisplay.PORTRAIT_FLIP, false, i2cadd) + end + cls() +end + +function cls() + if (consolemax==6) then gdisplay.clear() + else + gdisplay.rect( {0,0}, 128, 9*consolemax, {0,0,0}, {0,0,0} ) + end + if oledflip ~= 1 then gdisplay.clear() end + consolepos = 0 + consoletab={} + for i=0, consolemax do + consoletab[i] = "" + end +end + +function console(msg) + if (consolepos <= consolemax) then + consoletab[consolepos] = msg + gdisplay.write({0, consolepos*9},msg) + consolepos = consolepos+1 + else + for i = 1, consolemax do + consoletab[i-1] = consoletab[i] + end + consoletab[consolemax] = msg + if (consolemax==6) then gdisplay.clear() + else + gdisplay.rect( {0,0}, 128, 9*consolemax+9, {0,0,0}, {0,0,0} ) + end + for i=0, consolemax do + gdisplay.write({0, i*9},consoletab[i]) + end + end +end + +function top() + local l = thread.list(true) + cls() + for k,v in pairs(l) do + console(l[k]["thid"].." "..l[k]["name"].." "..l[k]["used_stack"]) + end +end + +function fonts() + cls() + gdisplay.setfont(gdisplay.FONT_DEFAULT) + console("DEFAULT") + tmr.delay(5); cls() + gdisplay.setfont(gdisplay.FONT_DEJAVU18) + console("DEJAVU18") + tmr.delay(5); cls() + gdisplay.setfont(gdisplay.FONT_DEJAVU24) + console("DEJAVU24") + tmr.delay(5); cls() + gdisplay.setfont(gdisplay.FONT_UBUNTU16) + console("UBUNTU16") + tmr.delay(5); cls() + gdisplay.setfont(gdisplay.FONT_COMIC24) + console("COMIC24") + tmr.delay(5); cls() + gdisplay.setfont(gdisplay.FONT_TOONEY32) + console("TOONEY32") + tmr.delay(5); cls() + gdisplay.setfont(gdisplay.FONT_MINYA24) + console("MINYA24") + tmr.delay(5); cls() + gdisplay.setfont(gdisplay.FONT_7SEG) + console("7SEG") + tmr.delay(5); cls() + gdisplay.setfont(gdisplay.FONT_LCD) + console("LCD") +end + +pcall( function() + cls() + console(">") +end) From 9a82196fd15ded1617ab600b7d38f2669b9d6212 Mon Sep 17 00:00:00 2001 From: Lukian Date: Wed, 23 Oct 2024 22:46:16 +0200 Subject: [PATCH 5/9] commit --- dht22.lua | 24 ----------- main.lua | 47 +++++++++++++++++++++ screen.lua | 117 ++++++++++++++++++++++++++--------------------------- 3 files changed, 104 insertions(+), 84 deletions(-) diff --git a/dht22.lua b/dht22.lua index 8811c12..aa987ba 100644 --- a/dht22.lua +++ b/dht22.lua @@ -23,30 +23,6 @@ function humi_neo(min, max) end end -function min(tab) - local min = tab[1] - for i=1,#tab do - if tab[i] < min then min = tab[i] end - end - return min -end - -function max(tab) - local max = tab[1] - for i=1,#tab do - if tab[i] > max then max = tab[i] end - end - return max -end - -function avg(tab) - local sum = 0 - for i=1,#tab do - sum = sum + tab[i] - end - return sum / #tab -end - function temp_humi_avg() temps = {} humis = {} diff --git a/main.lua b/main.lua index d4d4eb8..cf56f3c 100755 --- a/main.lua +++ b/main.lua @@ -19,6 +19,53 @@ function printTemp() print("Température du CPU :", cpu.temperature()) end +-- fonction permettant de trouver l'addresse I2C d'un écran OLED +function findaddr() + i2c.setpins(1, 18, 19) + ic = i2c.attach(i2c.I2C1, i2c.MASTER) + + for i = 0, 127 do + try( + function () + ic:start() + ic:address(i, false) + ic:stop() + print(string.format("found # %x", i)) + end, + + function() + print("failed") + end, + + function() end + ) + end +end + +function min(tab) + local min = tab[1] + for i=1,#tab do + if tab[i] < min then min = tab[i] end + end + return min +end + +function max(tab) + local max = tab[1] + for i=1,#tab do + if tab[i] > max then max = tab[i] end + end + return max +end + +function avg(tab) + local sum = 0 + for i=1,#tab do + sum = sum + tab[i] + end + return sum / #tab +end + -- charge tout nos fichiers lua dofile("leds.lua") dofile("buzz.lua") diff --git a/screen.lua b/screen.lua index dba744e..70674b2 100644 --- a/screen.lua +++ b/screen.lua @@ -6,40 +6,28 @@ -- cls() -- console() --- changer les valeurs qui suivent en fonction de --- vos branchements +-- fonction permettant se s'attacher à l'écran +function attachscreen(sda, scl, i2cadd) + try ( + function () + i2c.setpins(0,sda,scl) + gdisplay.attach(gdisplay.SSD1306_128_64, gdisplay.LANDSCAPE, false, i2cadd) + gdisplay.clear() + gdisplay.setfont(gdisplay.FONT_LCD) + gdisplay.setwrap(false) + end, --- GPIO pour I2C -local sda = 18 -local scl = 19 + function (where, line, error, message) + print("Couldn't attach the screen.\nError in "..where.." at "..line.." "..error..": "..message) + end, --- adresse ecran I2C -i2cadd = 0x3C - --- configuration -local reset16 = false -- reset ecran -i2c.setpins(0,sda,scl) -- config i2C - --- ecran -if reset16 then -- reset pour l'ecran si necessaire - pio.pin.setdir(pio.OUTPUT, pio.GPIO16); - pio.pin.setlow(pio.GPIO16) - tmr.delayms(50); - pio.pin.sethigh(pio.GPIO16) - tmr.delayms(50); + function () end + ) end -pcall( function() -- pas d'erreur - gdisplay.attach(gdisplay.SSD1306_128_64, gdisplay.LANDSCAPE, false, i2cadd) - gdisplay.clear() - gdisplay.setfont(gdisplay.FONT_LCD) - gdisplay.setwrap(false) -end) - local consolepos = 0 local consoletab = {} local consolemax = 6 - local oledflip = 1 function flip() @@ -101,37 +89,46 @@ function top() end end -function fonts() - cls() - gdisplay.setfont(gdisplay.FONT_DEFAULT) - console("DEFAULT") - tmr.delay(5); cls() - gdisplay.setfont(gdisplay.FONT_DEJAVU18) - console("DEJAVU18") - tmr.delay(5); cls() - gdisplay.setfont(gdisplay.FONT_DEJAVU24) - console("DEJAVU24") - tmr.delay(5); cls() - gdisplay.setfont(gdisplay.FONT_UBUNTU16) - console("UBUNTU16") - tmr.delay(5); cls() - gdisplay.setfont(gdisplay.FONT_COMIC24) - console("COMIC24") - tmr.delay(5); cls() - gdisplay.setfont(gdisplay.FONT_TOONEY32) - console("TOONEY32") - tmr.delay(5); cls() - gdisplay.setfont(gdisplay.FONT_MINYA24) - console("MINYA24") - tmr.delay(5); cls() - gdisplay.setfont(gdisplay.FONT_7SEG) - console("7SEG") - tmr.delay(5); cls() - gdisplay.setfont(gdisplay.FONT_LCD) - console("LCD") -end +-- fonction permettant de dessiner une courbe selon l'humidité captée par le capteur DHT22 +function displayhumi() + attachscreen(18, 19, 0x3C) + s = sensor.attach("DHT22", pio.GPIO21) + tmr.delayms(500) + width, height = gdisplay.getscreensize() -pcall( function() - cls() - console(">") -end) + values = {} + min_val = s:read("humidity") + max_val = s:read("humidity") + + while true do + humi = s:read("humidity") + -- changement des valeurs min et max + if humi < min_val then min_val = humi + elseif humi > max_val then max_val = humi end + -- si le tableau est plein alors on affiche la courbe + if #values == 10 then + for i=1,9 do + values[i] = values[i + 1] + end + values[10] = humi + cls() + -- on dessine chaque partie de la courbe + for i=1,9 do + -- on dessine la partie de courbe + gdisplay.line( + { + math.floor(i/10 * width), -- coordonnée x du premier point + math.floor((values[i] - min_val)/(max_val - min_val) * (height - 10) + 5) -- valeur comprise entre la val min et la val max avec des espaces de 5px et haut et en bas + }, + { + math.floor((i + 1)/10 * width), -- coordonnée x du deuxième point + math.floor((values[i + 1] - min_val)/(max_val - min_val) * (height - 10) + 5) -- valeur comprise entre la val min et la val max avec des espaces de 5px et haut et en bas + } + ) + end + else + values[#values + 1] = humi + end + tmr.delayms(500) + end +end From ff6be1c95b151da8b426a3717c79cc453e5cfeff Mon Sep 17 00:00:00 2001 From: Lukian Date: Thu, 24 Oct 2024 11:14:01 +0200 Subject: [PATCH 6/9] commit --- main.lua | 5 +++++ wifi.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 wifi.lua diff --git a/main.lua b/main.lua index cf56f3c..fb1cbf4 100755 --- a/main.lua +++ b/main.lua @@ -73,3 +73,8 @@ dofile("neopixel.lua") dofile("encoder.lua") dofile("dht22.lua") dofile("screen.lua") +dofile("wifi.lua") + +-- attache l'écran +attachscreen(18, 19, 0x3C) +console("Hello, world!") diff --git a/wifi.lua b/wifi.lua new file mode 100644 index 0000000..36068c8 --- /dev/null +++ b/wifi.lua @@ -0,0 +1,44 @@ +dofile("screen.lua") + +function displaynets() + nets = net.wf.scan(true) + cls() + for i=0,#nets-1 do + console(nets[i].ssid.." "..nets[i].rssi) + end +end + +function displayopennets() + nets = net.wf.scan(true) + cls() + for i=0,#nets-1 do + if nets[i].auth == net.wf.auth.OPEN then + console(nets[i].ssid.." "..nets[i].rssi) + end + end +end + +function scanwifi() + while true do + nets = net.wf.scan(true) + cls() + for i=0,#nets-1 do + console(nets[i].ssid.." "..nets[i].rssi) + end + tmr.delayms(1000) + end +end + +function neorssi() + neo = neopixel.attach(neopixel.WS2812B, pio.GPIO21, 8) + while true do + nets = net.wf.scan(true) + nb = (-nets[0].rssi) * 8 // 100 + for i=0,nb-1 do + r, g, b = wheelRGB(i * 255 // 8) + neo:setPixel(i, r//10, g//10, b//10) + end + neo:update() + tmr.delayms(1000) + end +end From 71d93de012bfd9e0da81875d919900565e10fa30 Mon Sep 17 00:00:00 2001 From: Lukian Date: Thu, 24 Oct 2024 17:49:35 +0200 Subject: [PATCH 7/9] commit --- screen.lua | 1 - wifi.lua | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/screen.lua b/screen.lua index 70674b2..b0a3d37 100644 --- a/screen.lua +++ b/screen.lua @@ -91,7 +91,6 @@ end -- fonction permettant de dessiner une courbe selon l'humidité captée par le capteur DHT22 function displayhumi() - attachscreen(18, 19, 0x3C) s = sensor.attach("DHT22", pio.GPIO21) tmr.delayms(500) width, height = gdisplay.getscreensize() diff --git a/wifi.lua b/wifi.lua index 36068c8..203d2d9 100644 --- a/wifi.lua +++ b/wifi.lua @@ -42,3 +42,39 @@ function neorssi() tmr.delayms(1000) end end + +function curverssi() + width, height = gdisplay.getscreensize() + + values = {} + + while true do + -- car le réseau avec le meilleur rssi est toujours premier dans la liste + rssi = net.wf.scan(true)[0].rssi + -- si le tableau est plein alors on affiche la courbe + if #values == 10 then + for i=1,9 do + values[i] = values[i + 1] + end + values[10] = rssi + cls() + -- on dessine chaque partie de la courbe + for i=1,9 do + -- on dessine la partie de courbe + gdisplay.line( + { + i * width // 10, + (-values[i]) * (height - 10) // 100 + 5 + }, + { + (i + 1) * width // 10, + (-values[i + 1]) * (height - 10) // 100 + 5 + } + ) + end + else + values[#values + 1] = rssi + end + tmr.delayms(500) + end +end From 183ab102f2151df2bddbe89c2d80efec35124dcc Mon Sep 17 00:00:00 2001 From: Lukian Date: Mon, 28 Oct 2024 13:11:21 +0100 Subject: [PATCH 8/9] commit --- autorun.lua | 3 +++ web.lua | 4 ++++ www/index.lua | 14 ++++++++++++++ www/style.css | 0 4 files changed, 21 insertions(+) create mode 100644 web.lua create mode 100644 www/index.lua create mode 100644 www/style.css diff --git a/autorun.lua b/autorun.lua index 1fa2846..4173513 100644 --- a/autorun.lua +++ b/autorun.lua @@ -7,3 +7,6 @@ printTemp() -- affiche le résultat du dé sur le neopixel -- dice() + +-- lance l'hotspot wifi et le serveur web +dofile("web.lua") diff --git a/web.lua b/web.lua new file mode 100644 index 0000000..9e03bc3 --- /dev/null +++ b/web.lua @@ -0,0 +1,4 @@ +nb = 0 +net.wf.setup(net.wf.mode.AP, "ESP32 Pierre", "sandwich134") +net.wf.start() +net.service.http.start() diff --git a/www/index.lua b/www/index.lua new file mode 100644 index 0000000..183277b --- /dev/null +++ b/www/index.lua @@ -0,0 +1,14 @@ + + + ESP 32 web page + + + +

Hello, world!

+ + + diff --git a/www/style.css b/www/style.css new file mode 100644 index 0000000..e69de29 From 8ac9dac055222552cb0c9b2c3019a3da9d189009 Mon Sep 17 00:00:00 2001 From: Lukian Date: Wed, 30 Oct 2024 12:10:58 +0100 Subject: [PATCH 9/9] commit --- web.lua | 4 ++++ www/buzz.lua | 8 ++++++++ www/index.lua | 28 ++++++++++++++++++++++++++-- www/ledoff.lua | 8 ++++++++ www/ledon.lua | 9 +++++++++ 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 www/buzz.lua create mode 100644 www/ledoff.lua create mode 100644 www/ledon.lua diff --git a/web.lua b/web.lua index 9e03bc3..06e22c0 100644 --- a/web.lua +++ b/web.lua @@ -1,3 +1,7 @@ +dofile("buzz.lua") +-- s = sensor.attach("DHT22", pio.GPIO21) +-- tmr.delayms(500) +nets = net.wf.scan(true) nb = 0 net.wf.setup(net.wf.mode.AP, "ESP32 Pierre", "sandwich134") net.wf.start() diff --git a/www/buzz.lua b/www/buzz.lua new file mode 100644 index 0000000..e448c71 --- /dev/null +++ b/www/buzz.lua @@ -0,0 +1,8 @@ + + + + + + diff --git a/www/index.lua b/www/index.lua index 183277b..c624e38 100644 --- a/www/index.lua +++ b/www/index.lua @@ -3,12 +3,36 @@ ESP 32 web page - +

Hello, world!

- +

DHT22

+ +

Led

+ +
+ +
+
+ +
+

Buzzer

+
+ +
+

Networks

+
    + "..nets[i].ssid.."") + end + ?> +
+ diff --git a/www/ledoff.lua b/www/ledoff.lua new file mode 100644 index 0000000..adc0dd2 --- /dev/null +++ b/www/ledoff.lua @@ -0,0 +1,8 @@ + + + + + + diff --git a/www/ledon.lua b/www/ledon.lua new file mode 100644 index 0000000..620dcc6 --- /dev/null +++ b/www/ledon.lua @@ -0,0 +1,9 @@ + + + + + + +