commit
This commit is contained in:
parent
89886ac0ea
commit
52c5047699
6 changed files with 199 additions and 11 deletions
34
out.lua
34
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é
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue