This commit is contained in:
Lukian 2024-10-12 21:53:58 +02:00
parent 89886ac0ea
commit 52c5047699
6 changed files with 199 additions and 11 deletions

34
out.lua
View file

@ -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é