commit
This commit is contained in:
parent
068d3a6f70
commit
e92123ab22
9 changed files with 328 additions and 174 deletions
30
main.lua
30
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
|
||||
end
|
||||
|
||||
-- charge tout nos fichiers lua
|
||||
dofile("leds.lua")
|
||||
dofile("buzz.lua")
|
||||
dofile("neopixel.lua")
|
||||
dofile("encoder.lua")
|
||||
dofile("dht22.lua")
|
||||
dofile("screen.lua")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue