Need advices for "linear leds"
-
- Posts: 57
- Joined: Sat Nov 26, 2016 9:58 pm
Re: Need advices for "linear leds"
Because each of them will be "switched on or off" if needed.
It will be the same for RPM, Oil press, Temp press and some other more.
Is there another way to do this ?
Edit : For Amperes :
If Amps value is < 60, then green leds will be on, depending the value from 0 to 59.
It will be the same for RPM, Oil press, Temp press and some other more.
Is there another way to do this ?
Edit : For Amperes :
If Amps value is < 60, then green leds will be on, depending the value from 0 to 59.
Re: Need advices for "linear leds"
Why not draw a shape in the canvas and set the opacity with the fill?
http://siminnovations.com/wiki/index.php?title=Fill
http://siminnovations.com/wiki/index.php?title=Fill
-
- Posts: 57
- Joined: Sat Nov 26, 2016 9:58 pm
Re: Need advices for "linear leds"
I will try and let you know !
- Keith Baxter
- Posts: 4674
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Need advices for "linear leds"
Hi,
Try this.
Keith
Try this.
Code: Select all
-- initalise your canvas
led = canvas_add(0, 0, 512, 512)
--This is the value coming from the sin
sim_value1=10
sim_value2=5
--Place the canvas_draw() inside the dataref subscribe. When the value of <sim_value> changes the number of LED's lit will change.
canvas_draw(led, function()
for i=1,sim_value1 do
_rect(0+(i*30),5,20,50,10)
if i <= 3 then
_fill("red")
else
_fill("green")
end
end
for i1=1,sim_value2 do
_rect(0+(i1*30),100,20,50,10)
if i1 <= 1 then
_fill("red")
elseif i1 > 1 and i1 < 3 then
_fill("yellow")
else
_fill("green")
end
end
end)
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
-
- Posts: 57
- Joined: Sat Nov 26, 2016 9:58 pm
Re: Need advices for "linear leds"
Keith, thank you !
Based on your code it's working as i wanted !
As you can see, leds are off and are visible. And 6 green leds are on.
Thank you again for your help and your time.
Based on your code it's working as i wanted !
As you can see, leds are off and are visible. And 6 green leds are on.
Thank you again for your help and your time.
- Keith Baxter
- Posts: 4674
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Need advices for "linear leds"
Hi,oscarDelta77 wrote: ↑Wed Dec 01, 2021 9:18 pm Keith, thank you !
Based on your code it's working as i wanted !
As you can see, leds are off and are visible. And 6 green leds are on.
Thank you again for your help and your time.
Awesome, that is great and looking good. Glad the code helped point you in the right direction. Just shout should you need other pointers.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Need advices for "linear leds"
@Keith Baxter
Hi Keith, you are a veritable wizard with the 'Canvas' functions. Nice one.
Joe
Hi Keith, you are a veritable wizard with the 'Canvas' functions. Nice one.
Joe
Joe. CISSP, MSc.
-
- Posts: 57
- Joined: Sat Nov 26, 2016 9:58 pm
Re: Need advices for "linear leds"
I agree !
- Keith Baxter
- Posts: 4674
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Need advices for "linear leds"
Too kind guys,
Thank you.
Keith
Thank you.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
-
- Posts: 57
- Joined: Sat Nov 26, 2016 9:58 pm
Re: Need advices for "linear leds"
Hi,
Almost finished fo these ones :
CT & GT values does not exist; so i will find a rule.
Again, thanks for your great help.
Almost finished fo these ones :
CT & GT values does not exist; so i will find a rule.
Again, thanks for your great help.